Class: EasyTable::Components::Span
- Inherits:
-
Object
- Object
- EasyTable::Components::Span
- Defined in:
- lib/easy_table/components/span.rb
Instance Method Summary collapse
- #head ⇒ Object
-
#initialize(node, title, label, html_opts, template, block) ⇒ Span
constructor
A new instance of Span.
- #td(record) ⇒ Object
Methods included from Spans
Methods included from Columns
Methods included from Base
Constructor Details
#initialize(node, title, label, html_opts, template, block) ⇒ Span
Returns a new instance of Span.
8 9 10 11 12 13 14 15 16 |
# File 'lib/easy_table/components/span.rb', line 8 def initialize(node, title, label, html_opts, template, block) @node = node @title = title @label = label @template = template @block = block @html_opts = html_opts block.call(self) end |
Instance Method Details
#head ⇒ Object
20 21 22 23 |
# File 'lib/easy_table/components/span.rb', line 20 def head opts = @html_opts.merge(colspan: colspan, scope: 'col') concat content_tag(:th, label, opts) end |
#td(record) ⇒ Object
25 26 27 28 29 |
# File 'lib/easy_table/components/span.rb', line 25 def td(record) columns.each do |col| col.td(record) end end |