Class: CassandraObject::Identity::UUIDKeyFactory
- Inherits:
-
AbstractKeyFactory
- Object
- AbstractKeyFactory
- CassandraObject::Identity::UUIDKeyFactory
- Defined in:
- lib/cassandra_object/identity/uuid_key_factory.rb
Overview
Key factories need to support 3 operations
Defined Under Namespace
Classes: UUID
Instance Method Summary collapse
-
#create(string) ⇒ Object
create should create a new key object from the cassandra format.
-
#next_key(object) ⇒ Object
Next key takes an object and returns the key object it should use.
-
#parse(string) ⇒ Object
Parse should create a new key object from the ‘to_param’ format.
Instance Method Details
#create(string) ⇒ Object
create should create a new key object from the cassandra format.
33 34 35 |
# File 'lib/cassandra_object/identity/uuid_key_factory.rb', line 33 def create(string) UUID.new(string) end |
#next_key(object) ⇒ Object
Next key takes an object and returns the key object it should use. object will be ignored with synthetic keys but could be useful with natural ones
21 22 23 |
# File 'lib/cassandra_object/identity/uuid_key_factory.rb', line 21 def next_key(object) UUID.new end |
#parse(string) ⇒ Object
Parse should create a new key object from the ‘to_param’ format
26 27 28 29 30 |
# File 'lib/cassandra_object/identity/uuid_key_factory.rb', line 26 def parse(string) UUID.new(string) rescue nil end |