Class: ThomasUtils::KeyIndexer
- Inherits:
-
Object
- Object
- ThomasUtils::KeyIndexer
- Includes:
- SymbolHelpers
- Defined in:
- lib/thomas_utils/key_indexer.rb
Constant Summary
Constants included from SymbolHelpers
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key, index) ⇒ KeyIndexer
constructor
A new instance of KeyIndexer.
- #to_s ⇒ Object
Methods included from SymbolHelpers
Constructor Details
#initialize(key, index) ⇒ KeyIndexer
Returns a new instance of KeyIndexer.
7 8 9 10 |
# File 'lib/thomas_utils/key_indexer.rb', line 7 def initialize(key, index) @key = key @index = index end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/thomas_utils/key_indexer.rb', line 5 def key @key end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/thomas_utils/key_indexer.rb', line 12 def to_s "#{@key}['#{@index}']" end |