Class: CassandraDB::Statements::Select

Inherits:
Base
  • Object
show all
Defined in:
lib/cassandra_db/statements.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#options, #to_s

Constructor Details

#initialize(table:, conditions: []) ⇒ Select

Returns a new instance of Select.



31
32
33
34
# File 'lib/cassandra_db/statements.rb', line 31

def initialize(table:, conditions:[])
  @table = table
  @conditions = conditions
end

Instance Attribute Details

#conditionsObject (readonly)

Returns the value of attribute conditions.



29
30
31
# File 'lib/cassandra_db/statements.rb', line 29

def conditions
  @conditions
end

#tableObject (readonly)

Returns the value of attribute table.



29
30
31
# File 'lib/cassandra_db/statements.rb', line 29

def table
  @table
end

Instance Method Details

#argumentsObject



40
41
42
# File 'lib/cassandra_db/statements.rb', line 40

def arguments
  @arguments ||= conditions_agruments
end

#cqlObject



36
37
38
# File 'lib/cassandra_db/statements.rb', line 36

def cql
  @cql ||= "SELECT * FROM #{table} #{where_cql}".strip
end