123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::MessagePack

Do not use. This module is for internal use only.
Relationships & Source Files
Namespace Children
Modules:
Classes:
Defined in: activerecord/lib/active_record/message_pack.rb

Constant Summary

Class Method Summary

Class Method Details

.dump(input)

[ GitHub ]

  
# File 'activerecord/lib/active_record/message_pack.rb', line 8

def dump(input)
  encoder = Encoder.new
  [FORMAT_VERSION, encoder.encode(input), encoder.entries]
end

.load(dumped)

[ GitHub ]

  
# File 'activerecord/lib/active_record/message_pack.rb', line 13

def load(dumped)
  format_version, top_level, entries = dumped
  unless format_version == FORMAT_VERSION
    raise "Invalid format version: #{format_version.inspect}"
  end
  Decoder.new(entries).decode(top_level)
end