Class: ROM::Cassandra::Query
- Inherits:
-
Object
- Object
- ROM::Cassandra::Query
- Defined in:
- lib/rom/cassandra/query.rb
Overview
Wraps the external CQL query builder
Constant Summary collapse
- DEFAULT_BUILDER =
Default CQL statements builder
QueryBuilder::CQL
Instance Method Summary collapse
-
#initialize(query = nil) ⇒ Query
constructor
Initializes the object carrying the lazy query.
-
#to_s ⇒ String
Builds the Query statement from the wrapped query.
Constructor Details
#initialize(query = nil) ⇒ Query
Initializes the object carrying the lazy query
18 19 20 |
# File 'lib/rom/cassandra/query.rb', line 18 def initialize(query = nil) @query = query || DEFAULT_BUILDER end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object (private)
36 37 38 39 |
# File 'lib/rom/cassandra/query.rb', line 36 def method_missing(name, *args) updated_query = @query.public_send(name, *args) self.class.new(updated_query) end |
Instance Method Details
#to_s ⇒ String
Builds the Query statement from the wrapped query
26 27 28 |
# File 'lib/rom/cassandra/query.rb', line 26 def to_s @query.to_s end |