Class: KXI::Collections::HashCollection::HashEnumerator::KeyValuePair
- Inherits:
-
Object
- Object
- KXI::Collections::HashCollection::HashEnumerator::KeyValuePair
- Defined in:
- lib/kxi/collections/hash_collection.rb
Overview
Represents a key-value pair
Instance Method Summary collapse
-
#initialize(k, v) ⇒ KeyValuePair
constructor
Instantiates the KeyValuePair class.
-
#key ⇒ Object
Returns the key of pair.
-
#value ⇒ Object
Returns the value of pair.
Constructor Details
#initialize(k, v) ⇒ KeyValuePair
Instantiates the KXI::Collections::HashCollection::HashEnumerator::KeyValuePair class
91 92 93 94 |
# File 'lib/kxi/collections/hash_collection.rb', line 91 def initialize(k, v) @key = k @val = v end |
Instance Method Details
#key ⇒ Object
Returns the key of pair
78 79 80 |
# File 'lib/kxi/collections/hash_collection.rb', line 78 def key @key end |
#value ⇒ Object
Returns the value of pair
84 85 86 |
# File 'lib/kxi/collections/hash_collection.rb', line 84 def value @val end |