Class: CassandraObject::Identity::CustomKeyFactory::CustomKey

Inherits:
Object
  • Object
show all
Includes:
Key
Defined in:
lib/cassandra_object/identity/custom_key_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ CustomKey

Returns a new instance of CustomKey.



9
10
11
# File 'lib/cassandra_object/identity/custom_key_factory.rb', line 9

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/cassandra_object/identity/custom_key_factory.rb', line 7

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



21
22
23
# File 'lib/cassandra_object/identity/custom_key_factory.rb', line 21

def ==(other)
  other.is_a?(CustomKey) && other.value == value
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/cassandra_object/identity/custom_key_factory.rb', line 25

def eql?(other)
  other == self
end

#to_paramObject



17
18
19
# File 'lib/cassandra_object/identity/custom_key_factory.rb', line 17

def to_param
  value
end

#to_sObject



13
14
15
# File 'lib/cassandra_object/identity/custom_key_factory.rb', line 13

def to_s
  value
end