Class: DatastaxRails::Cql::CreateIndex
- Defined in:
- lib/datastax_rails/cql/create_index.rb
Overview
:nodoc:
Instance Method Summary collapse
- #column(column) ⇒ Object
-
#initialize(index_name = nil) ⇒ CreateIndex
constructor
A new instance of CreateIndex.
- #on(cf_name) ⇒ Object
- #to_cql ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(index_name = nil) ⇒ CreateIndex
Returns a new instance of CreateIndex.
4 5 6 7 8 |
# File 'lib/datastax_rails/cql/create_index.rb', line 4 def initialize(index_name = nil) @cf_name = nil @column = nil @index_name = index_name end |
Instance Method Details
#column(column) ⇒ Object
15 16 17 18 |
# File 'lib/datastax_rails/cql/create_index.rb', line 15 def column(column) @column = column self end |
#on(cf_name) ⇒ Object
10 11 12 13 |
# File 'lib/datastax_rails/cql/create_index.rb', line 10 def on(cf_name) @cf_name = cf_name self end |
#to_cql ⇒ Object
20 21 22 |
# File 'lib/datastax_rails/cql/create_index.rb', line 20 def to_cql "CREATE INDEX #{@index_name} ON #{@cf_name} (#{@column})" end |