Sha256: c9dfee59113642e8ab6a91651d0033b790948e0bc19458c9e77f6105f4167ffe

Contents?: true

Size: 550 Bytes

Versions: 6

Compression:

Stored size: 550 Bytes

Contents

require "active_support/json"
require "msgpack_rails/activesupport/core_ext/object/to_msgpack"

module ActiveSupport
  module MessagePack
    def self.encode(value, options = nil)
      as_msgpack_opts, out = if options.is_a?(Hash)
                               [options, nil]
                             else
                               [nil, options]
                             end
      value.as_msgpack(as_msgpack_opts).msgpack_to_msgpack(out)
    end
  end
end

class Object
  def as_msgpack(options = nil)
    as_json(options)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
msgpack_rails-0.4.3 lib/msgpack_rails/activesupport/message_pack/encoding.rb
msgpack_rails-0.4.2 lib/msgpack_rails/activesupport/message_pack/encoding.rb
msgpack_rails-0.4.1 lib/msgpack_rails/activesupport/message_pack/encoding.rb
msgpack_rails-0.4.0 lib/msgpack_rails/activesupport/message_pack/encoding.rb
msgpack_rails-0.3.0 lib/msgpack_rails/activesupport/message_pack/encoding.rb
msgpack_rails-0.1.0 lib/msgpack_rails/activesupport/message_pack/encoding.rb