Class: OpenStax::Utilities::Blocks::TableCellBlock
- Defined in:
- lib/openstax/utilities/blocks/table_cell_block.rb
Instance Attribute Summary
Attributes inherited from BlockBase
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(template, block) ⇒ TableCellBlock
constructor
A new instance of TableCellBlock.
- #set_section_heading(colspan) ⇒ Object
Methods inherited from BlockBase
Constructor Details
#initialize(template, block) ⇒ TableCellBlock
Returns a new instance of TableCellBlock.
9 10 11 |
# File 'lib/openstax/utilities/blocks/table_cell_block.rb', line 9 def initialize(template, block) super(template, "table_cell", block) end |
Class Method Details
.from_value(template, value) ⇒ Object
13 14 15 16 17 |
# File 'lib/openstax/utilities/blocks/table_cell_block.rb', line 13 def self.from_value(template, value) tcb = TableCellBlock.new(template, Proc.new {}) tcb.captured_block = value tcb end |
Instance Method Details
#set_section_heading(colspan) ⇒ Object
19 20 21 22 23 |
# File 'lib/openstax/utilities/blocks/table_cell_block.rb', line 19 def set_section_heading(colspan) self.td_class_add "section-heading" self.td_colspan_add colspan self end |