Class: Cequel::Schema::Set
- Inherits:
-
CollectionColumn
- Object
- Column
- CollectionColumn
- Cequel::Schema::Set
- Defined in:
- lib/cequel/schema/column.rb
Overview
A Set column
Instance Attribute Summary
Attributes inherited from Column
Instance Method Summary collapse
-
#cast(value) ⇒ ::Set
Set with elements cast to correct type for column.
-
#to_cql ⇒ String
private
A CQL fragment representing this column in a table definition.
Methods inherited from CollectionColumn
#collection_column?, #indexed?
Methods inherited from Column
#==, #clustering_column?, #collection_column?, #data_column?, #indexed?, #initialize, #inspect, #key?, #partition_key?, #to_s, #type?
Constructor Details
This class inherits a constructor from Cequel::Schema::Column
Instance Method Details
#cast(value) ⇒ ::Set
Returns set with elements cast to correct type for column.
261 262 263 |
# File 'lib/cequel/schema/column.rb', line 261 def cast(value) value.to_set { |element| @type.cast(element) } end |
#to_cql ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a CQL fragment representing this column in a table definition.
253 254 255 |
# File 'lib/cequel/schema/column.rb', line 253 def to_cql "#{@name} SET <#{@type}>" end |