Class: Cequel::Schema::ClusteringColumn
- Defined in:
- lib/cequel/schema/column.rb
Overview
A clustering column
Instance Attribute Summary collapse
-
#clustering_order ⇒ :asc, :desc
readonly
Whether rows are ordered by ascending or descending values in this column.
Attributes inherited from Column
Instance Method Summary collapse
-
#clustering_column? ⇒ Boolean
True if this is a clustering column.
- #clustering_order_cql ⇒ Object
-
#initialize(name, type, clustering_order = nil) ⇒ ClusteringColumn
constructor
A new instance of ClusteringColumn.
Methods inherited from Column
#==, #cast, #collection_column?, #data_column?, #inspect, #key?, #partition_key?, #to_cql, #to_s, #type?
Constructor Details
#initialize(name, type, clustering_order = nil) ⇒ ClusteringColumn
Returns a new instance of ClusteringColumn.
153 154 155 156 |
# File 'lib/cequel/schema/column.rb', line 153 def initialize(name, type, clustering_order = nil) super(name, type) @clustering_order = (clustering_order || :asc).to_sym end |
Instance Attribute Details
#clustering_order ⇒ :asc, :desc (readonly)
Returns whether rows are ordered by ascending or descending values in this column.
146 147 148 |
# File 'lib/cequel/schema/column.rb', line 146 def clustering_order @clustering_order end |
Instance Method Details
#clustering_column? ⇒ Boolean
Returns true if this is a clustering column.
161 162 163 |
# File 'lib/cequel/schema/column.rb', line 161 def clustering_column? true end |
#clustering_order_cql ⇒ Object
166 167 168 |
# File 'lib/cequel/schema/column.rb', line 166 def clustering_order_cql "#{@name} #{@clustering_order}" end |