Class: Cequel::Type::Decimal

Inherits:
Base
  • Object
show all
Defined in:
lib/cequel/type.rb

Overview

`decimal` columns store decimal numeric values

See Also:

Since:

  • 1.0.0

Instance Method Summary collapse

Methods inherited from Base

#compatible_types, #cql_aliases, #cql_name, #internal_name, #internal_names, #to_s

Instance Method Details

#cast(value) ⇒ Object

Since:

  • 1.0.0


284
285
286
# File 'lib/cequel/type.rb', line 284

def cast(value)
  value.is_a?(BigDecimal) ? value : BigDecimal.new(value, 0)
end