Class: Restforce::Middleware::Mashify

Inherits:
Restforce::Middleware show all
Defined in:
lib/restforce/middleware/mashify.rb

Overview

Middleware the converts sobject records from JSON into Restforce::SObject objects and collections of records into Restforce::Collection objects.

Instance Method Summary collapse

Methods inherited from Restforce::Middleware

#client, #connection, #initialize

Constructor Details

This class inherits a constructor from Restforce::Middleware

Instance Method Details

#bodyObject



13
14
15
# File 'lib/restforce/middleware/mashify.rb', line 13

def body
  @env[:body]
end

#call(env) ⇒ Object



6
7
8
9
10
11
# File 'lib/restforce/middleware/mashify.rb', line 6

def call(env)
  @env = env
  response = @app.call(env)
  env[:body] = Restforce::Mash.build(body, client)
  response
end