Class: Cequel::Type::Uuid
Overview
‘uuid` columns store type 1 and type 4 UUIDs. Cequel uses the `CassandraCQL::UUID` type to represent UUIDs in Ruby, since this is what the underlying `cassandra-cql` library expects. Other UUID formats are supported as inputs.
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Base
#compatible_types, #cql_aliases, #cql_name, #internal_name, #to_s
Instance Method Details
#cast(value) ⇒ Object
382 383 384 385 386 387 388 |
# File 'lib/cequel/type.rb', line 382 def cast(value) case value when CassandraCQL::UUID then value when SimpleUUID::UUID then CassandraCQL::UUID.new(value.to_s) else CassandraCQL::UUID.new(value) end end |
#internal_names ⇒ Object
378 379 380 |
# File 'lib/cequel/type.rb', line 378 def internal_names ['org.apache.cassandra.db.marshal.UUIDType'] end |