Module: Cassandra::Mapper::Convert
Constant Summary collapse
- TEXT_TYPE =
'UTF8Type'
- TYPES =
{ uuid: 'TimeUUIDType', integer: 'Int32Type', time: 'DateType' }
Instance Method Summary collapse
- #from(type, value) ⇒ Object
- #round(type, value) ⇒ Object
- #to(type, value) ⇒ Object
- #type(symbol) ⇒ Object
Instance Method Details
#from(type, value) ⇒ Object
19 20 21 |
# File 'lib/cassandra/mapper/convert.rb', line 19 def from(type, value) send "from_#{type}", value end |
#round(type, value) ⇒ Object
23 24 25 |
# File 'lib/cassandra/mapper/convert.rb', line 23 def round(type, value) from type, to(type, value) end |
#to(type, value) ⇒ Object
15 16 17 |
# File 'lib/cassandra/mapper/convert.rb', line 15 def to(type, value) send "to_#{type}", value end |