Class: OOXML::Excel::Sheet::Row
- Inherits:
-
Object
- Object
- OOXML::Excel::Sheet::Row
- Defined in:
- lib/ooxml_excel/sheet.rb,
lib/ooxml_excel/sheet.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#cells ⇒ Object
Returns the value of attribute cells.
-
#id ⇒ Object
Returns the value of attribute id.
-
#spans ⇒ Object
Returns the value of attribute spans.
Class Method Summary collapse
Instance Method Summary collapse
- #[](id) ⇒ Object
-
#initialize(**attrs) ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize(**attrs) ⇒ Row
Returns a new instance of Row.
149 150 151 |
# File 'lib/ooxml_excel/sheet.rb', line 149 def initialize(**attrs) attrs.each { |property, value| send("#{property}=", value)} end |
Instance Attribute Details
#cells ⇒ Object
Returns the value of attribute cells.
147 148 149 |
# File 'lib/ooxml_excel/sheet.rb', line 147 def cells @cells end |
#id ⇒ Object
Returns the value of attribute id.
147 148 149 |
# File 'lib/ooxml_excel/sheet.rb', line 147 def id @id end |
#spans ⇒ Object
Returns the value of attribute spans.
147 148 149 |
# File 'lib/ooxml_excel/sheet.rb', line 147 def spans @spans end |
Class Method Details
.load_from_node(row_node, shared_strings, styles) ⇒ Object
162 163 164 165 166 |
# File 'lib/ooxml_excel/sheet.rb', line 162 def self.load_from_node(row_node, shared_strings, styles) new(id: row_node.attributes["r"].try(:value), spans: row_node.attributes["spans"].try(:value), cells: row_node.xpath('c').map { |cell_node| Row::Cell.load_from_node(cell_node, shared_strings, styles) } ) end |