Class: PnoteClient::Documents::Hml::TableRow
- Inherits:
-
Object
- Object
- PnoteClient::Documents::Hml::TableRow
- Defined in:
- lib/pnote_client/documents/hml/table_row.rb
Instance Attribute Summary collapse
-
#cells ⇒ Object
readonly
Returns the value of attribute cells.
Class Method Summary collapse
Instance Method Summary collapse
- #add_cell(cell) ⇒ Object
- #content ⇒ Object
-
#initialize ⇒ TableRow
constructor
A new instance of TableRow.
Constructor Details
#initialize ⇒ TableRow
Returns a new instance of TableRow.
20 21 22 |
# File 'lib/pnote_client/documents/hml/table_row.rb', line 20 def initialize @cells = [] end |
Instance Attribute Details
#cells ⇒ Object (readonly)
Returns the value of attribute cells.
18 19 20 |
# File 'lib/pnote_client/documents/hml/table_row.rb', line 18 def cells @cells end |
Class Method Details
.from_tag(row_tag) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/pnote_client/documents/hml/table_row.rb', line 7 def self.from_tag(row_tag) row = self.new = row_tag.xpath("CELL") .each do |cell_tag| row.add_cell(TableCell.from_tag(cell_tag)) end return row end |
Instance Method Details
#add_cell(cell) ⇒ Object
24 25 26 |
# File 'lib/pnote_client/documents/hml/table_row.rb', line 24 def add_cell(cell) @cells << cell end |
#content ⇒ Object
28 29 30 |
# File 'lib/pnote_client/documents/hml/table_row.rb', line 28 def content return @cells.map {|cell| cell.content} end |