Class: Spreadsheetkit::Cell
- Inherits:
-
Object
- Object
- Spreadsheetkit::Cell
- Defined in:
- lib/spreadsheetkit/cell.rb
Instance Attribute Summary collapse
-
#colspan ⇒ Object
Returns the value of attribute colspan.
-
#content ⇒ Object
Returns the value of attribute content.
-
#format ⇒ Object
Returns the value of attribute format.
-
#td ⇒ Object
Returns the value of attribute td.
Instance Method Summary collapse
- #additional_columns ⇒ Object
-
#initialize(td) ⇒ Cell
constructor
A new instance of Cell.
- #merge? ⇒ Boolean
Constructor Details
#initialize(td) ⇒ Cell
Returns a new instance of Cell.
6 7 8 9 10 11 |
# File 'lib/spreadsheetkit/cell.rb', line 6 def initialize(td) @td = td @colspan = @td[:colspan].to_i @content = @td.content.strip @format = Spreadsheetkit::Format.new(@td) end |
Instance Attribute Details
#colspan ⇒ Object
Returns the value of attribute colspan.
4 5 6 |
# File 'lib/spreadsheetkit/cell.rb', line 4 def colspan @colspan end |
#content ⇒ Object
Returns the value of attribute content.
4 5 6 |
# File 'lib/spreadsheetkit/cell.rb', line 4 def content @content end |
#format ⇒ Object
Returns the value of attribute format.
4 5 6 |
# File 'lib/spreadsheetkit/cell.rb', line 4 def format @format end |
#td ⇒ Object
Returns the value of attribute td.
4 5 6 |
# File 'lib/spreadsheetkit/cell.rb', line 4 def td @td end |
Instance Method Details
#additional_columns ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/spreadsheetkit/cell.rb', line 17 def additional_columns if merge? @colspan - 1 else 1 end end |
#merge? ⇒ Boolean
13 14 15 |
# File 'lib/spreadsheetkit/cell.rb', line 13 def merge? @colspan > 1 end |