Class: ROM::Configurable::Compiler Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rom/support/configurable/compiler.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Setting compiler used internally by the DSL

Instance Method Summary collapse

Instance Method Details

#call(ast) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
15
16
17
18
# File 'lib/rom/support/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) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



21
22
23
24
# File 'lib/rom/support/configurable/compiler.rb', line 21

def visit(node)
  type, rest = node
  public_send(:"visit_#{type}", rest)
end

#visit_nested(node) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
36
# File 'lib/rom/support/configurable/compiler.rb', line 33

def visit_nested(node)
  parent, children = node
  visit(parent).nested(call(children))
end

#visit_setting(node) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
30
# File 'lib/rom/support/configurable/compiler.rb', line 27

def visit_setting(node)
  name, opts = node
  Setting.new(name, **opts)
end