Sha256: 769670a651acc1a334f6e63190b6dac332abb93f2116648e74ec2375ca2e0389

Contents?: true

Size: 744 Bytes

Versions: 6

Compression:

Stored size: 744 Bytes

Contents

module Riddle
  class Configuration
    class TemplateIndex < Riddle::Configuration::Section
      include Riddle::Configuration::IndexSettings

      def self.settings
        Riddle::Configuration::IndexSettings.settings
      end

      attr_accessor :parent

      def initialize(name)
        @name = name
        @type = 'template'

        initialize_settings
      end

      def render
        raise ConfigurationError, "#{@name} #{@parent}" unless valid?

        inherited_name = "#{name}"
        inherited_name << " : #{parent}" if parent
        (
          ["index #{inherited_name}", "{"] +
          settings_body +
          ["}", ""]
        ).join("\n")
      end

      def valid?
        @name
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
riddle-2.2.0 lib/riddle/configuration/template_index.rb
riddle-2.1.0 lib/riddle/configuration/template_index.rb
riddle-2.0.0 lib/riddle/configuration/template_index.rb
riddle-1.5.12 lib/riddle/configuration/template_index.rb
riddle-1.5.11 lib/riddle/configuration/template_index.rb
riddle-1.5.10 lib/riddle/configuration/template_index.rb