Class: Riddle::Configuration::RealtimeIndex

Inherits:
Section
  • Object
show all
Defined in:
lib/riddle/configuration/realtime_index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ RealtimeIndex

Returns a new instance of RealtimeIndex.



10
11
12
13
14
15
16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 10

def initialize(name)
  @name               = name
  @rt_field           = []
  @rt_attr_uint       = []
  @rt_attr_bigint     = []
  @rt_attr_float      = []
  @rt_attr_timestamp  = []
  @rt_attr_string     = []
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/riddle/configuration/realtime_index.rb', line 7

def name
  @name
end

Instance Method Details

#renderObject

Raises:



28
29
30
31
32
33
34
35
36
# File 'lib/riddle/configuration/realtime_index.rb', line 28

def render
  raise ConfigurationError unless valid?
  
  (
    ["index #{name}", "{"] +
    settings_body +
    ["}", ""]
  ).join("\n")
end

#typeObject



20
21
22
# File 'lib/riddle/configuration/realtime_index.rb', line 20

def type
  "rt"
end

#valid?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/riddle/configuration/realtime_index.rb', line 24

def valid?
  !(@name.nil? || @path.nil?)
end