Class: ExcelAbstraction::Cell
- Inherits:
-
Object
- Object
- ExcelAbstraction::Cell
- Defined in:
- lib/excel_templating/excel_abstraction/cell.rb
Instance Attribute Summary collapse
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#styles ⇒ Object
readonly
Returns the value of attribute styles.
-
#val ⇒ Object
readonly
Returns the value of attribute val.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(attrs = {}) ⇒ Cell
constructor
A new instance of Cell.
- #to_cell ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Cell
Returns a new instance of Cell.
5 6 7 8 9 |
# File 'lib/excel_templating/excel_abstraction/cell.rb', line 5 def initialize(attrs = {}) @position = Integer(attrs.fetch(:position) { raise ArgumentError.new("Position absent for ExcelAbstraction cell") }) @val = attrs.fetch(:val) { raise ArgumentError.new("Value absent for ExcelAbstraction cell") } @styles = attrs.fetch(:styles) { {} } end |
Instance Attribute Details
#position ⇒ Object (readonly)
Returns the value of attribute position.
3 4 5 |
# File 'lib/excel_templating/excel_abstraction/cell.rb', line 3 def position @position end |
#styles ⇒ Object (readonly)
Returns the value of attribute styles.
3 4 5 |
# File 'lib/excel_templating/excel_abstraction/cell.rb', line 3 def styles @styles end |
#val ⇒ Object (readonly)
Returns the value of attribute val.
3 4 5 |
# File 'lib/excel_templating/excel_abstraction/cell.rb', line 3 def val @val end |
Instance Method Details
#<=>(other) ⇒ Object
11 12 13 |
# File 'lib/excel_templating/excel_abstraction/cell.rb', line 11 def <=>(other) position <=> other.position end |
#==(other) ⇒ Object
15 16 17 |
# File 'lib/excel_templating/excel_abstraction/cell.rb', line 15 def ==(other) position == other.position && val == other.val && styles == other.styles end |
#to_cell ⇒ Object
19 20 21 |
# File 'lib/excel_templating/excel_abstraction/cell.rb', line 19 def to_cell self end |