Class: Quandl::Cassandra::Types::DecimalType

Inherits:
AbstractType show all
Defined in:
lib/quandl/cassandra/types/decimal_type.rb

Instance Attribute Summary

Attributes inherited from AbstractType

#value

Class Method Summary collapse

Methods inherited from AbstractType

#initialize, quote_string, #sanitize, #sanitize_for_cql, sanitize_for_cql

Constructor Details

This class inherits a constructor from Quandl::Cassandra::Types::AbstractType

Class Method Details

.sanitize(value) ⇒ Object



3
4
5
6
7
# File 'lib/quandl/cassandra/types/decimal_type.rb', line 3

def self.sanitize(value)
  Float(value)
rescue
  raise Quandl::Cassandra::Error::CastException.new("Unable to convert value to #{name} #{value}", value)
end