Module: CassandraObject::Scope::QueryMethods
- Included in:
- CassandraObject::Scope
- Defined in:
- lib/cassandra_object/scope/query_methods.rb
Instance Method Summary collapse
- #limit(value) ⇒ Object
- #limit!(value) ⇒ Object
- #select(*values, &block) ⇒ Object
- #select!(*values) ⇒ Object
- #to_a ⇒ Object
- #to_cql ⇒ Object
- #where(*values) ⇒ Object
- #where!(*values) ⇒ Object
Instance Method Details
#limit(value) ⇒ Object
31 32 33 |
# File 'lib/cassandra_object/scope/query_methods.rb', line 31 def limit(value) clone.limit! value end |
#limit!(value) ⇒ Object
26 27 28 29 |
# File 'lib/cassandra_object/scope/query_methods.rb', line 26 def limit!(value) self.limit_value = value self end |
#select(*values, &block) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/cassandra_object/scope/query_methods.rb', line 9 def select(*values, &block) if block_given? to_a.select(&block) else clone.select! *values end end |
#select!(*values) ⇒ Object
4 5 6 7 |
# File 'lib/cassandra_object/scope/query_methods.rb', line 4 def select!(*values) self.select_values += values.flatten self end |
#to_a ⇒ Object
39 40 41 |
# File 'lib/cassandra_object/scope/query_methods.rb', line 39 def to_a instantiate_from_cql(adapter.build_query(self)) end |
#to_cql ⇒ Object
35 36 37 |
# File 'lib/cassandra_object/scope/query_methods.rb', line 35 def to_cql adapter.build_query(self) end |
#where(*values) ⇒ Object
22 23 24 |
# File 'lib/cassandra_object/scope/query_methods.rb', line 22 def where(*values) clone.where! values end |
#where!(*values) ⇒ Object
17 18 19 20 |
# File 'lib/cassandra_object/scope/query_methods.rb', line 17 def where!(*values) self.where_values += values.flatten self end |