Class: Osheet::Worksheet
- Inherits:
-
Object
- Object
- Osheet::Worksheet
- Includes:
- MetaElement
- Defined in:
- lib/osheet/worksheet.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
- #column(column_obj) ⇒ Object
-
#initialize(name = nil, *args) ⇒ Worksheet
constructor
A new instance of Worksheet.
- #name(value = nil) ⇒ Object
-
#row(row_obj) ⇒ Object
Osheet only stores the latest row in memory for reference memory bloat would be unmanageable in large spreadsheets if all rows were stored.
Methods included from MetaElement
Constructor Details
#initialize(name = nil, *args) ⇒ Worksheet
Returns a new instance of Worksheet.
16 17 18 19 20 |
# File 'lib/osheet/worksheet.rb', line 16 def initialize(name=nil, *args) @name = name @columns = [] @rows = [] end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
14 15 16 |
# File 'lib/osheet/worksheet.rb', line 14 def columns @columns end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
14 15 16 |
# File 'lib/osheet/worksheet.rb', line 14 def rows @rows end |
Instance Method Details
#column(column_obj) ⇒ Object
26 27 28 |
# File 'lib/osheet/worksheet.rb', line 26 def column(column_obj) @columns << column_obj end |
#name(value = nil) ⇒ Object
22 23 24 |
# File 'lib/osheet/worksheet.rb', line 22 def name(value=nil) value.nil? ? @name : @name = value.to_s end |
#row(row_obj) ⇒ Object
Osheet only stores the latest row in memory for reference memory bloat would be unmanageable in large spreadsheets if all rows were stored
33 34 35 36 |
# File 'lib/osheet/worksheet.rb', line 33 def row(row_obj) @rows.pop @rows << row_obj end |