Sha256: 79ac1dae7885978afe2ea00d83460aaf8ce97c4850e9a54911acec2d8a1207f6

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 Bytes

Contents

module Riddle
  class Configuration
    class Source < Riddle::Configuration::Section
      attr_accessor :name, :parent, :type

      def render
        raise ConfigurationError unless valid?

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
riddle-2.2.0 lib/riddle/configuration/source.rb