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

#call(env) ⇒ Object



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

def call(env)
  @app.call(env).on_complete do |completed_env|
    completed_env[:body] = Restforce::Mash.build(completed_env[:body], client)
  end
end