Class: ConvenientService::Support::Cache::Entities::Caches::Array::Entities::Pair

Inherits:
Object
  • Object
show all
Defined in:
lib/convenient_service/support/cache/entities/caches/array/entities/pair.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, value:) ⇒ void

Parameters:

  • key (Object)

    Can be any type.

  • value (Object)

    Can be any type.



28
29
30
31
# File 'lib/convenient_service/support/cache/entities/caches/array/entities/pair.rb', line 28

def initialize(key:, value:)
  @key = key
  @value = value
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



15
16
17
# File 'lib/convenient_service/support/cache/entities/caches/array/entities/pair.rb', line 15

def key
  @key
end

#valueObject

Returns the value of attribute value.



21
22
23
# File 'lib/convenient_service/support/cache/entities/caches/array/entities/pair.rb', line 21

def value
  @value
end

Instance Method Details

#==(other) ⇒ void

This method returns an undefined value.

Parameters:

  • other (Object)

    Can be any type.



37
38
39
40
41
42
43
44
# File 'lib/convenient_service/support/cache/entities/caches/array/entities/pair.rb', line 37

def ==(other)
  return unless other.instance_of?(self.class)

  return false if key != other.key
  return false if value != other.value

  true
end