class Dry::System::Settings::DSL

Attributes

identifier[R]
schema[R]

Public Class Methods

new(identifier, &block) click to toggle source
# File lib/dry/system/settings.rb, line 18
def initialize(identifier, &block)
  @identifier = identifier
  @schema = {}
  instance_eval(&block)
end

Public Instance Methods

call() click to toggle source
# File lib/dry/system/settings.rb, line 24
def call
  Core::ClassBuilder.new(name: "Configuration", parent: Configuration).call do |klass|
    schema.each do |key, type|
      klass.setting(key, type)
    end
  end
end
key(name, type) click to toggle source
# File lib/dry/system/settings.rb, line 32
def key(name, type)
  schema[name] = type
end