Class: Cassanity::Statement
- Inherits:
-
Object
- Object
- Cassanity::Statement
- Defined in:
- lib/cassanity/statement.rb
Instance Method Summary collapse
-
#initialize(cql, options = {}) ⇒ Statement
constructor
A new instance of Statement.
- #interpolate(variables) ⇒ Object
Constructor Details
#initialize(cql, options = {}) ⇒ Statement
Returns a new instance of Statement.
8 9 10 11 12 13 |
# File 'lib/cassanity/statement.rb', line 8 def initialize(cql, = {}) @cql = cql = @cql_version = .fetch(:cql_version, '3.0.0') end |
Instance Method Details
#interpolate(variables) ⇒ Object
15 16 17 18 |
# File 'lib/cassanity/statement.rb', line 15 def interpolate(variables) e = variables.to_enum @cql.gsub(/\?/) { quote(e.next) } end |