Class: Metadata::BuilderBase
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- Metadata::BuilderBase
- Defined in:
- app/models/metadata/builder_base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#locals ⇒ Object
writeonly
Sets the attribute locals.
Instance Method Summary collapse
-
#initialize(*args) ⇒ BuilderBase
constructor
A new instance of BuilderBase.
- #view_for(type, partial_name = nil) ⇒ Object
Constructor Details
#initialize(*args) ⇒ BuilderBase
Returns a new instance of BuilderBase.
5 6 7 8 |
# File 'app/models/metadata/builder_base.rb', line 5 def initialize(*args, &) super @views, @locals, @root = {}, {}, nil end |
Instance Attribute Details
#locals=(value) ⇒ Object (writeonly)
Sets the attribute locals
3 4 5 |
# File 'app/models/metadata/builder_base.rb', line 3 def locals=(value) @locals = value end |
Instance Method Details
#view_for(type, partial_name = nil) ⇒ Object
10 11 12 |
# File 'app/models/metadata/builder_base.rb', line 10 def view_for(type, partial_name = nil, &) @views[type.to_sym] = partial_name.nil? ? { inline: capture(&) } : { partial: partial_name } end |