Class: ActiveModel::Type::BigInteger
- Defined in:
- activemodel/lib/active_model/type/big_integer.rb
Overview
Attribute type for integers that can be serialized to an unlimited number of bytes. This type is registered under the :big_integer
key.
class Person
include ActiveModel::Attributes
attribute :id, :big_integer
end
person = Person.new
person.id = "18_000_000_000"
person.id # => 18000000000
All casting and serialization are performed in the same way as the standard ActiveModel::Type::Integer type.
Direct Known Subclasses
Constant Summary
Constants inherited from Integer
Instance Attribute Summary
Attributes inherited from Value
Instance Method Summary collapse
Methods inherited from Integer
#deserialize, #initialize, #serializable?, #serialize, #type
Methods included from Helpers::Numeric
Methods inherited from Value
#==, #as_json, #assert_valid_value, #binary?, #cast, #changed?, #changed_in_place?, #deserialize, #force_equality?, #hash, #immutable_value, #initialize, #map, #serializable?, #serialize, #type, #type_cast_for_schema, #value_constructed_by_mass_assignment?
Constructor Details
This class inherits a constructor from ActiveModel::Type::Integer
Instance Method Details
#serialize_cast_value(value) ⇒ Object
:nodoc:
24 25 26 |
# File 'activemodel/lib/active_model/type/big_integer.rb', line 24 def serialize_cast_value(value) # :nodoc: value end |