Module: CassandraObject::Model
- Included in:
- Base
- Defined in:
- lib/cassandra_object/model.rb
Instance Method Summary collapse
- #_key ⇒ Object
- #_keys ⇒ Object
- #allow_filtering ⇒ Object
- #allow_filtering=(value) ⇒ Object
- #base_class ⇒ Object
- #column_family ⇒ Object
- #column_family=(column_family) ⇒ Object
- #config ⇒ Object
- #config=(config) ⇒ Object
- #keys ⇒ Object
- #keys=(value) ⇒ Object
Instance Method Details
#_key ⇒ Object
32 33 34 35 |
# File 'lib/cassandra_object/model.rb', line 32 def _key # todo only first key _keys.first end |
#_keys ⇒ Object
37 38 39 |
# File 'lib/cassandra_object/model.rb', line 37 def _keys keys.tr('()','').gsub(/\s+/, "").split(',') end |
#allow_filtering ⇒ Object
28 29 30 |
# File 'lib/cassandra_object/model.rb', line 28 def allow_filtering @allow_filtering ||= false end |
#allow_filtering=(value) ⇒ Object
24 25 26 |
# File 'lib/cassandra_object/model.rb', line 24 def allow_filtering=(value) @allow_filtering = value end |
#base_class ⇒ Object
11 12 13 |
# File 'lib/cassandra_object/model.rb', line 11 def base_class class_of_active_record_descendant(self) end |
#column_family ⇒ Object
7 8 9 |
# File 'lib/cassandra_object/model.rb', line 7 def column_family @column_family ||= base_class.name.pluralize end |
#column_family=(column_family) ⇒ Object
3 4 5 |
# File 'lib/cassandra_object/model.rb', line 3 def column_family=(column_family) @column_family = column_family end |
#config ⇒ Object
19 20 21 22 |
# File 'lib/cassandra_object/model.rb', line 19 def config return self.custom_config if self.methods(false).include?(:custom_config) @@config end |
#config=(config) ⇒ Object
15 16 17 |
# File 'lib/cassandra_object/model.rb', line 15 def config=(config) @@config = config.deep_symbolize_keys end |
#keys ⇒ Object
45 46 47 |
# File 'lib/cassandra_object/model.rb', line 45 def keys @keys ||= '(key)' end |
#keys=(value) ⇒ Object
41 42 43 |
# File 'lib/cassandra_object/model.rb', line 41 def keys=(value) @keys = value end |