Module: CassandraObject::AttributeMethods::PrimaryKey

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/cassandra_object/attribute_methods/primary_key.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#attributesObject



20
21
22
# File 'lib/cassandra_object/attribute_methods/primary_key.rb', line 20

def attributes
  super.update(self.class.primary_key => id)
end

#idObject



12
13
14
# File 'lib/cassandra_object/attribute_methods/primary_key.rb', line 12

def id
  @id ||= self.class._generate_key(self)
end

#id=(id) ⇒ Object



16
17
18
# File 'lib/cassandra_object/attribute_methods/primary_key.rb', line 16

def id=(id)
  @id = id
end