Class: Camille::Types::Decimal
- Inherits:
-
Camille::Type
- Object
- BasicType
- Camille::Type
- Camille::Types::Decimal
- Includes:
- Camille::Types
- Defined in:
- lib/camille/generators/templates/decimal.rb
Instance Attribute Summary
Attributes inherited from Camille::Type
Attributes inherited from BasicType
Instance Method Summary collapse
-
#transform(value) ⇒ Object
transforms a BigDecimal into a Float so it fits in Number type.
Methods included from Camille::Types
Methods inherited from Camille::Type
alias_of, #check, inherited, #initialize, klass_name, #literal, #test, test
Methods inherited from BasicType
&, #&, [], #[], #check, directly_instantiable?, inherited, #initialize, instance, |, #|
Constructor Details
This class inherits a constructor from Camille::Type
Instance Method Details
#transform(value) ⇒ Object
transforms a BigDecimal into a Float so it fits in Number type
9 10 11 12 13 14 15 |
# File 'lib/camille/generators/templates/decimal.rb', line 9 def transform value if value.is_a? BigDecimal value.to_f else value end end |