Sha256: 6e6e31147511854d08f8d70f0f1adf6f000dc3222c077b7e7eb2cdc0768a3117
Contents?: true
Size: 1.01 KB
Versions: 5
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true module Riddle class Configuration class Index < Riddle::Configuration::Section include Riddle::Configuration::IndexSettings def self.settings Riddle::Configuration::IndexSettings.settings + [:source] end attr_accessor :parent, :sources def initialize(name, *sources) @name = name @sources = sources initialize_settings end def source @sources.collect { |s| s.name } end def render raise ConfigurationError, "#{@name} #{@sources.inspect} #{@path} #{@parent}" unless valid? inherited_name = parent ? "#{name} : #{parent}" : "#{name}" ( @sources.collect { |s| s.render } + ["index #{inherited_name}", "{"] + settings_body + ["}", ""] ).join("\n") end def valid? (!@name.nil?) && (!( @sources.length == 0 || @path.nil? ) || !@parent.nil?) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems