Module: CassandraObject::Scope::QueryMethods

Included in:
CassandraObject::Scope
Defined in:
lib/cassandra_object/scope/query_methods.rb

Instance Method Summary collapse

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_aObject



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_cqlObject



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