Class: Fino::Registry::DSL
- Inherits:
-
Object
- Object
- Fino::Registry::DSL
- Defined in:
- lib/fino/registry.rb
Defined Under Namespace
Classes: SectionDSL
Instance Method Summary collapse
-
#initialize(registry) ⇒ DSL
constructor
A new instance of DSL.
- #section(section_name, options = {}) ⇒ Object
- #setting(setting_name, type) ⇒ Object
Constructor Details
#initialize(registry) ⇒ DSL
Returns a new instance of DSL.
26 27 28 |
# File 'lib/fino/registry.rb', line 26 def initialize(registry) @registry = registry end |
Instance Method Details
#section(section_name, options = {}) ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fino/registry.rb', line 40 def section(section_name, = {}, &) section_definition = Fino::Definition::Section.new( name: section_name, ** ) @registry.register_section(section_definition) SectionDSL.new(section_definition, @registry).instance_eval(&) end |
#setting(setting_name, type) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/fino/registry.rb', line 30 def setting(setting_name, type, **) @registry.register( Fino::Definition::Setting.new( type: type, setting_name: setting_name, ** ) ) end |