Module: CassandraIntegration::Base::InstanceMethods

Defined in:
lib/cassandra_integration/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#coming_from_cassandraObject

Returns the value of attribute coming_from_cassandra.



18
19
20
# File 'lib/cassandra_integration/base.rb', line 18

def coming_from_cassandra
  @coming_from_cassandra
end

Instance Method Details

#coming_from_cassandra?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/cassandra_integration/base.rb', line 20

def coming_from_cassandra?
  !self.coming_from_cassandra.blank?
end

#replicateObject



24
25
26
# File 'lib/cassandra_integration/base.rb', line 24

def replicate
  CassandraIntegration::Proxy.new(self).sync
end

#set_cassandra_sync_identifierObject



28
29
30
31
# File 'lib/cassandra_integration/base.rb', line 28

def set_cassandra_sync_identifier
  raise 'Your model does not have cassandra_sync_identifier column.' unless self.respond_to? :cassandra_sync_identifier
  self.cassandra_sync_identifier = to_cassandra_sync_identifier if self.cassandra_sync_identifier.blank?
end

#to_cassandra_sync_identifierObject



33
34
35
# File 'lib/cassandra_integration/base.rb', line 33

def to_cassandra_sync_identifier
  raise 'Method to_cassandra_sync_identifier is not implemented!'
end