Class: YiffSpace::Utils::TableBuilder::Row
- Defined in:
- lib/yiffspace/utils/table_builder.rb
Overview
Represents a custom row in the table body.
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#row_attributes ⇒ Object
readonly
Returns the value of attribute row_attributes.
Instance Method Summary collapse
- #custom? ⇒ Boolean
-
#initialize(row_attributes = {}, &block) ⇒ Row
constructor
A new instance of Row.
- #value(index) ⇒ Object
Constructor Details
#initialize(row_attributes = {}, &block) ⇒ Row
Returns a new instance of Row.
86 87 88 89 |
# File 'lib/yiffspace/utils/table_builder.rb', line 86 def initialize(row_attributes = {}, &block) @row_attributes = row_attributes @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
84 85 86 |
# File 'lib/yiffspace/utils/table_builder.rb', line 84 def block @block end |
#row_attributes ⇒ Object (readonly)
Returns the value of attribute row_attributes.
84 85 86 |
# File 'lib/yiffspace/utils/table_builder.rb', line 84 def row_attributes @row_attributes end |
Instance Method Details
#custom? ⇒ Boolean
91 92 93 |
# File 'lib/yiffspace/utils/table_builder.rb', line 91 def custom? true end |
#value(index) ⇒ Object
95 96 97 98 99 100 101 102 |
# File 'lib/yiffspace/utils/table_builder.rb', line 95 def value(index) view = block.binding.receiver if view.respond_to?(:capture) view.capture { block.call(index, self) } else block.call(index, self) end end |