Class: Rspreadsheet::RowGroup
- Inherits:
-
RowWithXMLNode
- Object
- Row
- RowWithXMLNode
- Rspreadsheet::RowGroup
- Defined in:
- lib/rspreadsheet/row.rb
Instance Attribute Summary collapse
-
#parent_array ⇒ Object
Returns the value of attribute parent_array.
-
#range ⇒ Object
Returns the value of attribute range.
-
#xmlnode ⇒ Object
Returns the value of attribute xmlnode.
Instance Method Summary collapse
-
#initialize(aparent_array, arange, axmlnode = nil) ⇒ RowGroup
constructor
A new instance of RowGroup.
-
#normalize ⇒ Object
returns SingleRow if size of range is 1 and nil if it is 0 or less.
- #repeated ⇒ Object
- #repeated? ⇒ Boolean
Methods inherited from RowWithXMLNode
#add_cell, #cellnodes, #cells, #first_unused_column_index, #nonemptycells, #nonemptycellsindexes, #style_name=, #used_col_range, #used_range
Methods inherited from Row
Constructor Details
#initialize(aparent_array, arange, axmlnode = nil) ⇒ RowGroup
Returns a new instance of RowGroup.
181 182 183 184 185 186 187 188 189 |
# File 'lib/rspreadsheet/row.rb', line 181 def initialize(aparent_array,arange,axmlnode=nil) @parent_array = aparent_array @range = arange if axmlnode.nil? axmlnode = Row.empty_row_node Tools.set_ns_attribute(axmlnode,'table','number-rows-repeated',range.size) if range.size>1 end @xmlnode = axmlnode end |
Instance Attribute Details
#parent_array ⇒ Object
Returns the value of attribute parent_array.
180 181 182 |
# File 'lib/rspreadsheet/row.rb', line 180 def parent_array @parent_array end |
#range ⇒ Object
Returns the value of attribute range.
179 180 181 |
# File 'lib/rspreadsheet/row.rb', line 179 def range @range end |
#xmlnode ⇒ Object
Returns the value of attribute xmlnode.
180 181 182 |
# File 'lib/rspreadsheet/row.rb', line 180 def xmlnode @xmlnode end |
Instance Method Details
#normalize ⇒ Object
returns SingleRow if size of range is 1 and nil if it is 0 or less
191 192 193 194 195 196 197 |
# File 'lib/rspreadsheet/row.rb', line 191 def normalize case range.size when 2..Float::INFINITY then self when 1 then SingleRow.new_from_rowgroup(self) else nil end end |
#repeated ⇒ Object
198 |
# File 'lib/rspreadsheet/row.rb', line 198 def repeated; range.size end |
#repeated? ⇒ Boolean
199 |
# File 'lib/rspreadsheet/row.rb', line 199 def repeated?; range.size>1 end |