Class: Voom::Presenters::DSL::Components::Table
- Defined in:
- lib/voom/presenters/dsl/components/table.rb
Defined Under Namespace
Classes: Row
Instance Attribute Summary collapse
-
#header(**attribs, &block) ⇒ Object
Returns the value of attribute header.
-
#rows ⇒ Object
Returns the value of attribute rows.
-
#selectable ⇒ Object
Returns the value of attribute selectable.
Attributes inherited from Base
#attributes, #context, #id, #type
Instance Method Summary collapse
-
#initialize(**attribs_, &block) ⇒ Table
constructor
A new instance of Table.
- #row(**attribs, &block) ⇒ Object
Methods inherited from Base
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ Table
Returns a new instance of Table.
15 16 17 18 19 20 |
# File 'lib/voom/presenters/dsl/components/table.rb', line 15 def initialize(**attribs_, &block) super(type: :table, **attribs_, &block) @selectable = attribs.delete(:selectable) @rows = [] end |
Instance Attribute Details
#header(**attribs, &block) ⇒ Object
Returns the value of attribute header.
13 14 15 |
# File 'lib/voom/presenters/dsl/components/table.rb', line 13 def header @header end |
#rows ⇒ Object
Returns the value of attribute rows.
13 14 15 |
# File 'lib/voom/presenters/dsl/components/table.rb', line 13 def rows @rows end |
#selectable ⇒ Object
Returns the value of attribute selectable.
13 14 15 |
# File 'lib/voom/presenters/dsl/components/table.rb', line 13 def selectable @selectable end |
Instance Method Details
#row(**attribs, &block) ⇒ Object
29 30 31 32 33 |
# File 'lib/voom/presenters/dsl/components/table.rb', line 29 def row(**attribs, &block) @rows << Row.new(parent: self, type: :row, context: context, **attribs, &block) end |