Class: CassandraObject::Scope
- Inherits:
-
Object
- Object
- CassandraObject::Scope
- Includes:
- Batches, FinderMethods, QueryMethods
- Defined in:
- lib/cassandra_object/scope.rb,
lib/cassandra_object/scope/batches.rb,
lib/cassandra_object/scope/query_methods.rb,
lib/cassandra_object/scope/finder_methods.rb
Defined Under Namespace
Modules: Batches, FinderMethods, QueryMethods
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#limit_value ⇒ Object
Returns the value of attribute limit_value.
-
#select_values ⇒ Object
Returns the value of attribute select_values.
-
#where_values ⇒ Object
Returns the value of attribute where_values.
Instance Method Summary collapse
-
#initialize(klass) ⇒ Scope
constructor
A new instance of Scope.
Methods included from Batches
Methods included from FinderMethods
#all, #find, #find_by_id, #first
Methods included from QueryMethods
#limit, #limit!, #select, #select!, #to_a, #to_cql, #where, #where!
Constructor Details
#initialize(klass) ⇒ Scope
12 13 14 15 16 17 18 |
# File 'lib/cassandra_object/scope.rb', line 12 def initialize(klass) @klass = klass @limit_value = nil @select_values = [] @where_values = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object (private)
21 22 23 24 25 26 27 28 29 |
# File 'lib/cassandra_object/scope.rb', line 21 def method_missing(method_name, *args, &block) if klass.respond_to?(method_name) klass.send(method_name, *args, &block) elsif Array.method_defined?(method_name) to_a.send(method_name, *args, &block) else super end end |
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
9 10 11 |
# File 'lib/cassandra_object/scope.rb', line 9 def klass @klass end |
#limit_value ⇒ Object
Returns the value of attribute limit_value.
10 11 12 |
# File 'lib/cassandra_object/scope.rb', line 10 def limit_value @limit_value end |
#select_values ⇒ Object
Returns the value of attribute select_values.
10 11 12 |
# File 'lib/cassandra_object/scope.rb', line 10 def select_values @select_values end |
#where_values ⇒ Object
Returns the value of attribute where_values.
10 11 12 |
# File 'lib/cassandra_object/scope.rb', line 10 def where_values @where_values end |