Class: KXI::Collections::HashCollection::HashEnumerator::KeyValuePair

Inherits:
Object
  • Object
show all
Defined in:
lib/kxi/collections/hash_collection.rb

Overview

Represents a key-value pair

Instance Method Summary collapse

Constructor Details

#initialize(k, v) ⇒ KeyValuePair

Parameters:

  • k (Object)

    Key of pair

  • v (Object)

    Value of pair



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

#keyObject

Returns the key of pair

Returns:

  • (Object)

    Key of pair



78
79
80
# File 'lib/kxi/collections/hash_collection.rb', line 78

def key
	@key
end

#valueObject

Returns the value of pair

Returns:

  • (Object)

    Value of pair



84
85
86
# File 'lib/kxi/collections/hash_collection.rb', line 84

def value
	@val
end