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
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, &block) ⇒ Object
9 10 11 |
# File 'lib/brainstem/dsl/fields_block.rb', line 9 def fields(name, &block) descend FieldsBlock, configuration.nest!(name), &block end |