Class: ActiveModel::Type::BigInteger

Inherits:
Integer show all
Defined in:
lib/active_model/type/big_integer.rb

Overview

Active Model BigInteger Type

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.

Constant Summary

Constants inherited from Integer

Integer::DEFAULT_LIMIT

Instance Attribute Summary

Attributes inherited from Value

#limit, #precision, #scale

Instance Method Summary collapse

Methods inherited from Integer

#deserialize, #initialize, #serializable?, #serialize, #type

Methods included from Helpers::Numeric

#cast, #changed?, #serialize

Methods inherited from Value

#==, #as_json, #assert_valid_value, #binary?, #cast, #changed?, #changed_in_place?, #deserialize, #force_equality?, #hash, #initialize, #map, #mutable?, #serializable?, #serialize, #serialized?, #type, #type_cast_for_schema, #value_constructed_by_mass_assignment?

Methods included from SerializeCastValue

included, #initialize, #itself_if_serialize_cast_value_compatible, serialize

Constructor Details

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

Instance Method Details

#serialize_cast_value(value) ⇒ Object

:nodoc:



26
27
28
# File 'lib/active_model/type/big_integer.rb', line 26

def serialize_cast_value(value) # :nodoc:
  value
end