Module: ActiveResource::Formats::MsgpackFormat
- Extended by:
- MsgpackFormat
- Included in:
- MsgpackFormat
- Defined in:
- lib/msgpack_rails/3/activeresource_formats/msgpack_format.rb
Instance Method Summary collapse
- #decode(mpac) ⇒ Object
-
#encode(hash, options = nil) ⇒ Object
Options hash currently serves no function.
- #extension ⇒ Object
- #mime_type ⇒ Object
Instance Method Details
#decode(mpac) ⇒ Object
20 21 22 |
# File 'lib/msgpack_rails/3/activeresource_formats/msgpack_format.rb', line 20 def decode(mpac) MessagePack.unpack(mpac) end |
#encode(hash, options = nil) ⇒ Object
Options hash currently serves no function. TODO: Fix it, duh. Just like the Serializer’s issue
16 17 18 |
# File 'lib/msgpack_rails/3/activeresource_formats/msgpack_format.rb', line 16 def encode(hash, = nil) hash.to_msgpack end |
#extension ⇒ Object
6 7 8 |
# File 'lib/msgpack_rails/3/activeresource_formats/msgpack_format.rb', line 6 def extension "mpac" end |
#mime_type ⇒ Object
10 11 12 |
# File 'lib/msgpack_rails/3/activeresource_formats/msgpack_format.rb', line 10 def mime_type Mime::MPAC.to_s end |