Class: ThomasUtils::KeyIndexer

Inherits:
Object
  • Object
show all
Includes:
SymbolHelpers
Defined in:
lib/thomas_utils/key_indexer.rb

Constant Summary

Constants included from SymbolHelpers

SymbolHelpers::OPERATOR_MAP

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SymbolHelpers

#child, #index

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

#keyObject (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_sObject



12
13
14
# File 'lib/thomas_utils/key_indexer.rb', line 12

def to_s
  "#{@key}['#{@index}']"
end