Class: OpenAPI::Handlers::Hashie

Inherits:
OpenAPI::Handler show all
Defined in:
lib/openapi/handlers/hashie.rb

Class Method Summary collapse

Methods inherited from OpenAPI::Handler

failed

Class Method Details

.hashie(snake_name, response, options) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/openapi/handlers/hashie.rb', line 5

def hashie(snake_name, response, options)
  return self.failed(response) if not response.success?
  klass_name = snake_name.camelize
  hash = JSON.parse(response.raw)
  resp = Payplug::Model::Response.new(hash)
  return OpenAPI::Handlers::Response.wrap(resp, response)
end