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?, #indexed?, #inspect, #key?, #partition_key?, #to_cql, #to_s, #type?
Constructor Details
#initialize(name, type, clustering_order = nil) ⇒ ClusteringColumn
Returns a new instance of ClusteringColumn.
163 164 165 166 |
# File 'lib/cequel/schema/column.rb', line 163 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.
156 157 158 |
# File 'lib/cequel/schema/column.rb', line 156 def clustering_order @clustering_order end |
Instance Method Details
#clustering_column? ⇒ Boolean
Returns true if this is a clustering column.
171 172 173 |
# File 'lib/cequel/schema/column.rb', line 171 def clustering_column? true end |
#clustering_order_cql ⇒ Object
176 177 178 |
# File 'lib/cequel/schema/column.rb', line 176 def clustering_order_cql "#{@name} #{@clustering_order}" end |