Class: ActiveModel::Type::Decimal

Inherits:
Value
  • Object
show all
Includes:
Helpers::Numeric
Defined in:
lib/active_model/type/decimal.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Value

#limit, #precision, #scale

Instance Method Summary collapse

Methods included from Helpers::Numeric

#cast, #changed?

Methods inherited from Value

#==, #assert_valid_value, #binary?, #cast, #changed?, #changed_in_place?, #deserialize, #hash, #initialize, #map, #serialize

Constructor Details

This class inherits a constructor from ActiveModel::Type::Value

Instance Method Details

#typeObject



8
9
10
# File 'lib/active_model/type/decimal.rb', line 8

def type
  :decimal
end

#type_cast_for_schema(value) ⇒ Object



12
13
14
# File 'lib/active_model/type/decimal.rb', line 12

def type_cast_for_schema(value)
  value.to_s.inspect
end