Module: EPayCo::Response

Defined in:
lib/epayco/response.rb

Class Method Summary collapse

Class Method Details

.create(response, response_options) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/epayco/response.rb', line 3

def self.create( response, response_options)
  return response if response_options[:raw]
  return response.body if response_options[:no_response_wrapper]      
  if response_options[:return_object]
    begin
      object_key = response_options[:return_object].is_a?(String) ? response_options[:return_object] : response.body.object
      return response.body[object_key]
    end
  end
  info = response.body.dup
  info.extend( self )
  info
end