Class: Brainstem::Concerns::PresenterDSL::FieldsBlock
- Defined in:
- lib/brainstem/dsl/fields_block.rb
Instance Attribute Summary
Attributes inherited from BaseBlock
#block_options, #configuration
Instance Method Summary collapse
- #field(name, type, options = {}) ⇒ Object
- #fields(name, type = :hash, options = {}, &block) ⇒ Object
Methods inherited from BaseBlock
Constructor Details
This class inherits a constructor from Brainstem::Concerns::PresenterDSL::BaseBlock
Instance Method Details
#field(name, type, options = {}) ⇒ Object
5 6 7 |
# File 'lib/brainstem/dsl/fields_block.rb', line 5 def field(name, type, = {}) configuration[name] = DSL::Field.new(name, type, smart_merge(, ())) end |
#fields(name, type = :hash, options = {}, &block) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/brainstem/dsl/fields_block.rb', line 9 def fields(name, type = :hash, = {}, &block) nested_field = DSL::BlockField.for(name, type, smart_merge(, ()), configuration[name]) configuration[name] = nested_field descend self.class, nested_field.configuration, (, ), &block end |