Class: CassandraObject::Identity::HashedNaturalKeyFactory

Inherits:
NaturalKeyFactory show all
Defined in:
lib/cassandra_object/identity/hashed_natural_key_factory.rb

Instance Attribute Summary

Attributes inherited from NaturalKeyFactory

#attributes, #separator

Instance Method Summary collapse

Methods inherited from NaturalKeyFactory

#create, #initialize, #parse

Methods inherited from AbstractKeyFactory

#create, #parse

Constructor Details

This class inherits a constructor from CassandraObject::Identity::NaturalKeyFactory

Instance Method Details

#next_key(object) ⇒ Object



5
6
7
# File 'lib/cassandra_object/identity/hashed_natural_key_factory.rb', line 5

def next_key(object)
  NaturalKey.new(Digest::SHA1.hexdigest(attributes.map { |a| object.attributes[a.to_s] }.join(separator)))
end