Class: SmoothOperator::HttpHandlers::Typhoeus::RemoteCall

Inherits:
Operator::RemoteCall show all
Defined in:
lib/smooth_operator/http_handlers/typhoeus/remote_call.rb

Constant Summary

Constants inherited from Operator::RemoteCall

Operator::RemoteCall::HTTP_SUCCESS_CODES

Instance Attribute Summary collapse

Attributes inherited from Operator::RemoteCall

#exception, #parsed_response, #protocol_handler, #raw_response, #response

Instance Method Summary collapse

Methods inherited from Operator::RemoteCall

#<<, #==, #code, #error?, #get_attributes, #ok?, #respond_to?, #successful_response?, #to_s

Constructor Details

#initialize(request) ⇒ RemoteCall

Returns a new instance of RemoteCall.



11
12
13
# File 'lib/smooth_operator/http_handlers/typhoeus/remote_call.rb', line 11

def initialize(request)
  @request = request
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class SmoothOperator::Operator::RemoteCall

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



9
10
11
# File 'lib/smooth_operator/http_handlers/typhoeus/remote_call.rb', line 9

def request
  @request
end

Instance Method Details

#parse_responseObject



15
16
17
18
19
20
21
# File 'lib/smooth_operator/http_handlers/typhoeus/remote_call.rb', line 15

def parse_response
  begin
    @parse_response ||= ::HTTParty::Parser.call(@raw_response.body, :json)
  rescue
    nil
  end
end