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-4.0.13 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.12 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.11 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.10 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.9 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.7.3 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.7.2 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.8 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.7 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.6 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.5 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.4 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.3 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.2 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.1 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.0 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.7.1 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.7.0 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.6.1 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.6.0 lib/cassandra_object/identity/hashed_natural_key_factory.rb