Class: PnoteClient::Documents::Hml::TableRow

Inherits:
Object
  • Object
show all
Defined in:
lib/pnote_client/documents/hml/table_row.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTableRow

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

#cellsObject (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

  cell_tags = row_tag.xpath("CELL")
  cell_tags.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

#contentObject



28
29
30
# File 'lib/pnote_client/documents/hml/table_row.rb', line 28

def content
  return @cells.map {|cell| cell.content}
end