class Riddle::Configuration::RealtimeIndex

Attributes

name[RW]

Public Class Methods

new(name) click to toggle source
# File lib/riddle/configuration/realtime_index.rb, line 14
def initialize(name)
  @name               = name
  @rt_field           = []
  @rt_attr_uint       = []
  @rt_attr_bigint     = []
  @rt_attr_float      = []
  @rt_attr_timestamp  = []
  @rt_attr_string     = []
end
settings() click to toggle source
# File lib/riddle/configuration/realtime_index.rb, line 4
def self.settings
  [
    :type, :path, :rt_mem_limit, :rt_field, :rt_attr_uint,
    :rt_attr_bigint, :rt_attr_float, :rt_attr_timestamp, :rt_attr_string
  ]
end

Public Instance Methods

render() click to toggle source
# File lib/riddle/configuration/realtime_index.rb, line 32
def render
  raise ConfigurationError unless valid?
  
  (
    ["index #{name}", "{"] +
    settings_body +
    ["}", ""]
  ).join("\n")
end
type() click to toggle source
# File lib/riddle/configuration/realtime_index.rb, line 24
def type
  "rt"
end
valid?() click to toggle source
# File lib/riddle/configuration/realtime_index.rb, line 28
def valid?
  !(@name.nil? || @path.nil?)
end