Class: CassandraObject::Base
- Inherits:
-
Object
- Object
- CassandraObject::Base
- 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
- .base_class ⇒ Object
- .column_family ⇒ Object
- .column_family=(column_family) ⇒ Object
- .config ⇒ Object
- .config=(config) ⇒ Object
Methods included from Core
#==, #eql?, #hash, #initialize, #initialize_dup, #to_param
Methods included from Savepoints
Methods included from Callbacks
Methods included from BelongsTo
Methods included from AttributeMethods::PrimaryKey
Methods included from AttributeMethods::Dirty
#reload, #save, #save!, #write_attribute
Methods included from Validations
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_class ⇒ Object
17 18 19 |
# File 'lib/cassandra_object/base.rb', line 17 def base_class class_of_active_record_descendant(self) end |
.column_family ⇒ Object
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 |
.config ⇒ Object
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 |