Class: CassandraObject::Base

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Naming, ActiveSupport::DescendantsTracker
Includes:
ActiveModel::Conversion, AttributeMethods, AttributeMethods::Dirty, AttributeMethods::PrimaryKey, AttributeMethods::Typecasting, BelongsTo, Callbacks, Connection, Consistency, Core, Identity, Inspect, Persistence, Savepoints, Scoping, Serialization, Timestamps, Validations
Defined in:
lib/cassandra_object/base.rb

Class Method Summary collapse

Methods included from Core

#==, #eql?, #hash, #initialize, #initialize_dup, #to_param

Methods included from Savepoints

#destroy

Methods included from Callbacks

#destroy

Methods included from BelongsTo

#belongs_to_association

Methods included from AttributeMethods::PrimaryKey

#attributes, #id, #id=

Methods included from AttributeMethods::Dirty

#reload, #save, #save!, #write_attribute

Methods included from Validations

#save, #save!

Methods included from AttributeMethods

#attribute_exists?, #attributes, #attributes=, #method_missing, #read_attribute, #respond_to?, #write_attribute

Methods included from Persistence

#becomes, #destroy, #destroyed?, #new_record?, #persisted?, #reload, #save, #update_attribute, #update_attributes, #update_attributes!

Methods included from Inspect

#attribute_for_inspect, #inspect

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CassandraObject::AttributeMethods

Class Method Details

.base_classObject



17
18
19
# File 'lib/cassandra_object/base.rb', line 17

def base_class
  class_of_active_record_descendant(self)
end

.column_familyObject



13
14
15
# File 'lib/cassandra_object/base.rb', line 13

def column_family
  @column_family ||= base_class.name.pluralize
end

.column_family=(column_family) ⇒ Object



9
10
11
# File 'lib/cassandra_object/base.rb', line 9

def column_family=(column_family)
  @column_family = column_family
end

.configObject



25
26
27
# File 'lib/cassandra_object/base.rb', line 25

def config
  @@config
end

.config=(config) ⇒ Object



21
22
23
# File 'lib/cassandra_object/base.rb', line 21

def config=(config)
  @@config = config.is_a?(Hash) ? CassandraObject::Config.new(config) : config
end