Class: Restify::Processors::Msgpack

Inherits:
Base
  • Object
show all
Includes:
Parsing
Defined in:
lib/restify/processors/msgpack.rb

Overview

Decode messagepack encoded responses.

Fields matching *_url will be parsed as relations.

Instance Attribute Summary

Attributes inherited from Base

#context, #response

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#body, #initialize, #load, #resource

Constructor Details

This class inherits a constructor from Restify::Processors::Base

Class Method Details

.accept?(response) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/restify/processors/msgpack.rb', line 20

def accept?(response)
  response.content_type =~ %r{\Aapplication/(x-)?msgpack($|;)}
end

Instance Method Details

#deserialized_bodyObject



15
16
17
# File 'lib/restify/processors/msgpack.rb', line 15

def deserialized_body
  ::MessagePack.unpack(body)
end