Module: ActiveRecord::Serialization

Includes:
ActiveModel::Serializers::Msgpack
Defined in:
lib/msgpack_rails/3/msgpack_serializer.rb,
lib/msgpack_rails/2-3/msgpack_serializer.rb

Defined Under Namespace

Classes: MsgpackSerializer

Instance Method Summary collapse

Instance Method Details

#to_msgpack(options = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/msgpack_rails/2-3/msgpack_serializer.rb', line 3

def to_msgpack(options = {})
  options = {:out => options} if options.is_a?(String)
  options[:out] ||= ''

  options[:out] << MsgpackSerializer.new(self).to_s
end