class Riddle::Configuration::TemplateIndex

Attributes

parent[RW]

Public Class Methods

new(name) click to toggle source
# File lib/riddle/configuration/template_index.rb, line 13
def initialize(name)
  @name = name
  @type = 'template'

  initialize_settings
end
settings() click to toggle source
# File lib/riddle/configuration/template_index.rb, line 7
def self.settings
  Riddle::Configuration::IndexSettings.settings
end

Public Instance Methods

render() click to toggle source
# File lib/riddle/configuration/template_index.rb, line 20
def render
  raise ConfigurationError, "#{@name} #{@parent}" unless valid?

  inherited_name = "#{name}"
  inherited_name << " : #{parent}" if parent
  (
    ["index #{inherited_name}", "{"] +
    settings_body +
    ["}", ""]
  ).join("\n")
end
valid?() click to toggle source
# File lib/riddle/configuration/template_index.rb, line 32
def valid?
  @name
end