Class: DisplayFor::Builder::Base
- Inherits:
-
Object
- Object
- DisplayFor::Builder::Base
- Defined in:
- lib/display_for/builder/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#html_options ⇒ Object
readonly
Returns the value of attribute html_options.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#resource_class ⇒ Object
readonly
Returns the value of attribute resource_class.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #action(name, options = {}, &block) ⇒ Object
- #attribute(name, options = {}, &block) ⇒ Object
- #html(name, options = {}, &block) ⇒ Object
-
#initialize(html_options, template, &block) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(html_options, template, &block) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 15 |
# File 'lib/display_for/builder/base.rb', line 8 def initialize(, template, &block) @template = template @attributes = [] @actions = [] @html_options = block.call(self) if block_given? end |
Instance Attribute Details
#html_options ⇒ Object (readonly)
Returns the value of attribute html_options.
4 5 6 |
# File 'lib/display_for/builder/base.rb', line 4 def @html_options end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
4 5 6 |
# File 'lib/display_for/builder/base.rb', line 4 def namespace @namespace end |
#resource_class ⇒ Object (readonly)
Returns the value of attribute resource_class.
4 5 6 |
# File 'lib/display_for/builder/base.rb', line 4 def resource_class @resource_class end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
4 5 6 |
# File 'lib/display_for/builder/base.rb', line 4 def template @template end |
Instance Method Details
#action(name, options = {}, &block) ⇒ Object
21 22 23 |
# File 'lib/display_for/builder/base.rb', line 21 def action(name, = {}, &block) @actions << Element::Action.new(self, name, , &block) end |