method

install

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Extensions
install(registry) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/message_pack/extensions.rb, line 20
      def install(registry)
        registry.register_type 0, Symbol,
          packer: :to_msgpack_ext,
          unpacker: :from_msgpack_ext,
          optimized_symbols_parsing: true

        registry.register_type 1, Integer,
          packer: ::MessagePack::Bigint.method(:to_msgpack_ext),
          unpacker: ::MessagePack::Bigint.method(:from_msgpack_ext),
          oversized_integer_extension: true

        registry.register_type 2, BigDecimal,
          packer: :_dump,
          unpacker: :_load

        registry.register_type 3, Rational,
          packer: method(:write_rational),
          unpacker: method(:read_rational),
          recursive: true

        registry.register_type 4, Complex,
          packer: method(:write_complex),
          unpacker: method(:read_complex),
          recursive: true

        registry.register_type 5, DateTime,
          packer: method(:write_datetime),
          unpacker: method(:read_datetime),
          recursive: true

        registry.register_type 6, Date,
          packer: method(:write_date),
          unpacker: method(:read_date),
          recursive: true

        registry.register_type 7, Time,
          packer: method(:write_time),
          unpacker: method(:read_time),
          recursive: true

        registry.register_type 8, ActiveSupport::TimeWithZone,
          packer: method(:write_time_with_zone),
          unpacker: method(:read_time_with_zone),
          recursive: true

        registry.register_type 9, ActiveSupport::TimeZone,
          packer: method(:dump_time_zone),
          unpacker: method(:load_time_zone)

        registry.register_type 10, ActiveSupport::Duration,
          packer: method(:write_duration),
          unpacker: method(:read_duration),
          recursive: true

        registry.register_type 11, Range,
          packer: method(:write_range),
          unpacker: method(:read_range),
          recursive: true

        registry.register_type 12, Set,
          packer: method(:write_set),
          unpacker: method(:read_set),
          recursive: true

        registry.register_type 13, URI::Generic,
          packer: :to_s,
          unpacker: URI.method(:parse)

        registry.register_type 14, IPAddr,
          packer: :to_s,
          unpacker: :new

        registry.register_type 15, Pathname,
          packer: :to_s,
          unpacker: :new

        registry.register_type 16, Regexp,
          packer: :to_s,
          unpacker: :new

        registry.register_type 17, ActiveSupport::HashWithIndifferentAccess,
          packer: method(:write_hash_with_indifferent_access),
          unpacker: method(:read_hash_with_indifferent_access),
          recursive: true
      end
Register or log in to add new notes.