Module: CassandraMapper::Identity

Included in:
Base
Defined in:
lib/cassandra_mapper/identity.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



13
14
15
# File 'lib/cassandra_mapper/identity.rb', line 13

def self.included(klass)
  klass.extend ClassMethods
end

Instance Method Details

#keyObject



17
18
19
# File 'lib/cassandra_mapper/identity.rb', line 17

def key
  read_attribute(self.class.key)
end

#new_record=(flag) ⇒ Object



21
22
23
# File 'lib/cassandra_mapper/identity.rb', line 21

def new_record=(flag)
  @cassandra_mapper_new_record = (flag && true) || false
end

#new_record?Boolean

Returns:

  • (Boolean)


25
26
27
28
# File 'lib/cassandra_mapper/identity.rb', line 25

def new_record?
  @cassandra_mapper_new_record = true unless defined? @cassandra_mapper_new_record
  @cassandra_mapper_new_record
end