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.32 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.31 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.30 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.29 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.28 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.27 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.26 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.25 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.24 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.23 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.22 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.21 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.20 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.7.5 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-2.7.4 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.18 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.17 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.16 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.15 lib/cassandra_object/identity/hashed_natural_key_factory.rb
sessionm-cassandra_object-4.0.14 lib/cassandra_object/identity/hashed_natural_key_factory.rb