Class: Osheet::Cell
- Inherits:
-
Object
- Object
- Osheet::Cell
- Includes:
- MetaElement, StyledElement
- Defined in:
- lib/osheet/cell.rb
Instance Method Summary collapse
- #colspan(value = nil) ⇒ Object
- #data(value = nil) ⇒ Object
- #format(value = nil, opts = {}) ⇒ Object
- #formula(value = nil) ⇒ Object
- #href(value = nil) ⇒ Object
- #index(value = nil) ⇒ Object
-
#initialize(data_value = nil) ⇒ Cell
constructor
A new instance of Cell.
- #rowspan(value = nil) ⇒ Object
Methods included from StyledElement
Methods included from MetaElement
Constructor Details
#initialize(data_value = nil) ⇒ Cell
Returns a new instance of Cell.
12 13 14 15 16 17 18 19 20 |
# File 'lib/osheet/cell.rb', line 12 def initialize(data_value=nil) @data = cast_data_value(data_value) @format = Format.new(:general) @rowspan = 1 @colspan = 1 @index = nil @href = nil @formula = nil end |
Instance Method Details
#colspan(value = nil) ⇒ Object
34 35 36 |
# File 'lib/osheet/cell.rb', line 34 def colspan(value=nil) value.nil? ? @colspan : @colspan = value end |
#data(value = nil) ⇒ Object
22 23 24 |
# File 'lib/osheet/cell.rb', line 22 def data(value=nil) value.nil? ? @data : @data = cast_data_value(value) end |
#format(value = nil, opts = {}) ⇒ Object
26 27 28 |
# File 'lib/osheet/cell.rb', line 26 def format(value=nil, opts={}) value.nil? ? @format : @format = Format.new(value, opts) end |
#formula(value = nil) ⇒ Object
46 47 48 |
# File 'lib/osheet/cell.rb', line 46 def formula(value=nil) value.nil? ? @formula : @formula = value end |
#href(value = nil) ⇒ Object
42 43 44 |
# File 'lib/osheet/cell.rb', line 42 def href(value=nil) value.nil? ? @href : @href = value end |
#index(value = nil) ⇒ Object
38 39 40 |
# File 'lib/osheet/cell.rb', line 38 def index(value=nil) value.nil? ? @index : @index = value end |
#rowspan(value = nil) ⇒ Object
30 31 32 |
# File 'lib/osheet/cell.rb', line 30 def rowspan(value=nil) value.nil? ? @rowspan : @rowspan = value end |