Sha256: 13a2c4d517b45c8557253040f35ca79874affea703a89a0718eb349eaa06d8ff

Contents?: true

Size: 285 Bytes

Versions: 184

Compression:

Stored size: 285 Bytes

Contents

require 'digest/sha1'
module CassandraObject
  module Identity
    class HashedNaturalKeyFactory < NaturalKeyFactory
      def next_key(object)
        NaturalKey.new(Digest::SHA1.hexdigest(attributes.map { |a| object.attributes[a.to_s] }.join(separator)))
      end
    end
  end
end

Version data entries

184 entries across 184 versions & 2 rubygems

Version Path
sessionm-cassandra_object-2.5.9 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.5.8 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.5.7 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.5.6 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.5.5 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.5.4 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.5.3 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.5.2 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.5.1 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.5.0 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.4.9 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.4.8 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.4.7 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.4.6 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.4.5 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.4.4 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.4.3 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.4.2 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.4.1 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.4.0 lib/cassandra_object/identity/hashed_natural_key_factory.rb