Class: HasHelpers::Dataset
- Inherits:
-
Object
- Object
- HasHelpers::Dataset
- Includes:
- Attributes, UIAttributes
- Defined in:
- lib/has_helpers/utils/dataset.rb
Instance Attribute Summary collapse
- #data ⇒ Object
-
#table ⇒ Object
Returns the value of attribute table.
Attributes included from UIAttributes::HTMLAttributes
Instance Method Summary collapse
Methods included from Attributes::GuardedAttributes
Methods included from UIAttributes::HTMLAttributes
Methods included from Attributes
Instance Attribute Details
#data ⇒ Object
30 31 32 |
# File 'lib/has_helpers/utils/dataset.rb', line 30 def data @data ||= [] end |
#table ⇒ Object
Returns the value of attribute table.
9 10 11 |
# File 'lib/has_helpers/utils/dataset.rb', line 9 def table @table end |
Instance Method Details
#to_renderable ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/has_helpers/utils/dataset.rb', line 12 def to_renderable Container.new( renderable: data.map do |row| Container.new( renderable: row.map do |cell| Container.new( renderable: cell, tag: :span, skin: "cell" ) end, skin: "row" ) end, skin: [*skin, "dataset", *(table && "table")].join(" ") ) end |