Class: Roo::Excelx::Cell::Base
- Inherits:
-
Object
- Object
- Roo::Excelx::Cell::Base
- Defined in:
- lib/roo/excelx/cell/base.rb
Instance Attribute Summary collapse
-
#cell_type ⇒ Object
readonly
Returns the value of attribute cell_type.
-
#cell_value ⇒ Object
readonly
Returns the value of attribute cell_value.
-
#style ⇒ Object
readonly
FIXME: I think style should be deprecated.
-
#value ⇒ Object
(also: #formatted_value)
Returns the value of attribute value.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#excelx_type ⇒ Object
DEPRECATED: Please use cell_type instead.
-
#excelx_value ⇒ Object
DEPRECATED: Please use cell_value instead.
- #formula? ⇒ Boolean
-
#hyperlink ⇒ Object
DEPRECATED: Please use link instead.
-
#initialize(value, formula, excelx_type, style, link, coordinate) ⇒ Base
constructor
A new instance of Base.
- #link? ⇒ Boolean
- #to_s ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(value, formula, excelx_type, style, link, coordinate) ⇒ Base
Returns a new instance of Base.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/roo/excelx/cell/base.rb', line 36 def initialize(value, formula, excelx_type, style, link, coordinate) @link = !!link @cell_value = value @cell_type = excelx_type @formula = formula @style = style @coordinate = coordinate @type = :base @value = link? ? Roo::Link.new(link, value) : value end |
Instance Attribute Details
#cell_type ⇒ Object (readonly)
Returns the value of attribute cell_type.
5 6 7 |
# File 'lib/roo/excelx/cell/base.rb', line 5 def cell_type @cell_type end |
#cell_value ⇒ Object (readonly)
Returns the value of attribute cell_value.
5 6 7 |
# File 'lib/roo/excelx/cell/base.rb', line 5 def cell_value @cell_value end |
#style ⇒ Object (readonly)
FIXME: I think style should be deprecated. Having a style attribute
for a cell doesn't really accomplish much. It seems to be used
when you want to export to excelx.
10 11 12 |
# File 'lib/roo/excelx/cell/base.rb', line 10 def style @style end |
#value ⇒ Object Also known as: formatted_value
Returns the value of attribute value.
5 6 7 |
# File 'lib/roo/excelx/cell/base.rb', line 5 def value @value end |
Instance Method Details
#excelx_type ⇒ Object
DEPRECATED: Please use cell_type instead.
83 84 85 86 |
# File 'lib/roo/excelx/cell/base.rb', line 83 def excelx_type warn '[DEPRECATION] `excelx_type` is deprecated. Please use `cell_type` instead.' cell_type end |
#excelx_value ⇒ Object
DEPRECATED: Please use cell_value instead.
77 78 79 80 |
# File 'lib/roo/excelx/cell/base.rb', line 77 def excelx_value warn '[DEPRECATION] `excelx_value` is deprecated. Please use `cell_value` instead.' cell_value end |
#formula? ⇒ Boolean
57 58 59 |
# File 'lib/roo/excelx/cell/base.rb', line 57 def formula? !!@formula end |
#hyperlink ⇒ Object
DEPRECATED: Please use link instead.
72 73 74 |
# File 'lib/roo/excelx/cell/base.rb', line 72 def hyperlink warn '[DEPRECATION] `hyperlink` is deprecated. Please use `link` instead.' end |
#to_s ⇒ Object
67 68 69 |
# File 'lib/roo/excelx/cell/base.rb', line 67 def to_s formatted_value end |
#type ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/roo/excelx/cell/base.rb', line 47 def type if formula? :formula elsif link? :link else @type end end |