Sha256: 5e4bae943f9ba3d18268581dd25d328bb5a90f0ebab5af80aa35e3cee82bf9a9
Contents?: true
Size: 413 Bytes
Versions: 5
Compression:
Stored size: 413 Bytes
Contents
module PassiveRecord class SecureRandomIdentifier < Struct.new(:value) def self.generate(klass) new(generate_id_value_for(klass)) end def self.generate_id_value_for(*) SecureRandom.uuid end def ==(other_id) self.value == other_id || (other_id.is_a?(SecureRandomIdentifier) && self.value == other_id&.value) end def inspect value end end end
Version data entries
5 entries across 5 versions & 1 rubygems