Class: NTable::IndexWrapper
- Inherits:
-
Object
- Object
- NTable::IndexWrapper
- Defined in:
- lib/ntable/index_wrapper.rb
Overview
Use one of these in a coordinate to force the coordinate to be treated as an index rather than a label.
Instance Attribute Summary collapse
-
#value ⇒ Object
(also: #to_i)
readonly
Retrieve the actual index.
Instance Method Summary collapse
-
#eql?(rhs_) ⇒ Boolean
(also: #==)
Standard equality checker.
-
#hash ⇒ Object
Standard hash value.
-
#initialize(val_) ⇒ IndexWrapper
constructor
Create an IndexWrapper with the given integer index.
Constructor Details
#initialize(val_) ⇒ IndexWrapper
Create an IndexWrapper with the given integer index
48 49 50 |
# File 'lib/ntable/index_wrapper.rb', line 48 def initialize(val_) @value = val_.to_i end |
Instance Attribute Details
#value ⇒ Object (readonly) Also known as: to_i
Retrieve the actual index
70 71 72 |
# File 'lib/ntable/index_wrapper.rb', line 70 def value @value end |
Instance Method Details
#eql?(rhs_) ⇒ Boolean Also known as: ==
Standard equality checker
55 56 57 |
# File 'lib/ntable/index_wrapper.rb', line 55 def eql?(rhs_) rhs_.is_a?(IndexWrapper) && @value == @rhs_.value end |
#hash ⇒ Object
Standard hash value
63 64 65 |
# File 'lib/ntable/index_wrapper.rb', line 63 def hash @value.hash end |