Class: Force::Middleware::Mashify

Inherits:
Force::Middleware show all
Defined in:
lib/force/middleware/mashify.rb

Overview

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

Instance Method Summary collapse

Methods inherited from Force::Middleware

#client, #connection, #initialize

Constructor Details

This class inherits a constructor from Force::Middleware

Instance Method Details

#bodyObject



12
13
14
# File 'lib/force/middleware/mashify.rb', line 12

def body
  @env[:body]
end

#call(env) ⇒ Object



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

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