class Dry::Configurable::Compiler

Setting compiler used internally by the DSL

@api private

Public Instance Methods

call(ast) click to toggle source
# File lib/dry/configurable/compiler.rb, line 12
def call(ast)
  Settings.new.tap do |settings|
    ast.each do |node|
      settings << visit(node)
    end
  end
end
visit(node) click to toggle source

@api private

# File lib/dry/configurable/compiler.rb, line 21
def visit(node)
  type, rest = node
  public_send(:"visit_#{type}", rest)
end
visit_nested(node) click to toggle source

@api private

# File lib/dry/configurable/compiler.rb, line 33
def visit_nested(node)
  parent, children = node
  visit(parent).nested(call(children))
end
visit_setting(node) click to toggle source

@api private

# File lib/dry/configurable/compiler.rb, line 27
def visit_setting(node)
  name, opts = node
  Setting.new(name, **opts)
end