Class: PoiSpreadsheet::Worksheet
- Inherits:
-
Object
- Object
- PoiSpreadsheet::Worksheet
- Defined in:
- lib/poi_spreadsheet.rb
Defined Under Namespace
Classes: Row
Instance Attribute Summary collapse
-
#book ⇒ Object
Returns the value of attribute book.
-
#j_sheet ⇒ Object
Returns the value of attribute j_sheet.
Class Method Summary collapse
Instance Method Summary collapse
-
#[](row) ⇒ Object
get cell.
-
#initialize ⇒ Worksheet
constructor
A new instance of Worksheet.
-
#set(x, y) ⇒ Object
set cell.
Constructor Details
#initialize ⇒ Worksheet
Returns a new instance of Worksheet.
99 100 101 |
# File 'lib/poi_spreadsheet.rb', line 99 def initialize @rows = {} end |
Instance Attribute Details
#book ⇒ Object
Returns the value of attribute book.
96 97 98 |
# File 'lib/poi_spreadsheet.rb', line 96 def book @book end |
#j_sheet ⇒ Object
Returns the value of attribute j_sheet.
95 96 97 |
# File 'lib/poi_spreadsheet.rb', line 95 def j_sheet @j_sheet end |
Class Method Details
.from_sheet(j_sheet) ⇒ Object
118 119 120 121 122 |
# File 'lib/poi_spreadsheet.rb', line 118 def self.from_sheet j_sheet sheet = new sheet.j_sheet = j_sheet sheet end |
Instance Method Details
#[](row) ⇒ Object
get cell
104 105 106 107 108 109 110 111 |
# File 'lib/poi_spreadsheet.rb', line 104 def [](row) @rows[row] ||= begin j_row = j_sheet.getRow(row) row = Row.from_row j_row row.sheet = self row end end |
#set(x, y) ⇒ Object
set cell
114 115 116 |
# File 'lib/poi_spreadsheet.rb', line 114 def set(x, y) end |