Class: Cequel::Schema::List
- Inherits:
-
CollectionColumn
- Object
- Column
- CollectionColumn
- Cequel::Schema::List
- Defined in:
- lib/cequel/schema/column.rb
Overview
A List column
Instance Attribute Summary
Attributes inherited from Column
Instance Method Summary collapse
-
#cast(value) ⇒ Array
Array 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) ⇒ Array
Returns array with elements cast to correct type for column.
240 241 242 |
# File 'lib/cequel/schema/column.rb', line 240 def cast(value) value.map { |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.
233 234 235 |
# File 'lib/cequel/schema/column.rb', line 233 def to_cql "#{@name} LIST <#{@type}>" end |