Class: PayoneerApi::Request
- Inherits:
-
Object
- Object
- PayoneerApi::Request
- Defined in:
- lib/payoneer_api/request.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#options ⇒ Object
Returns the value of attribute options.
-
#request_method ⇒ Object
Returns the value of attribute request_method.
Instance Method Summary collapse
- #initialize(client, request_method, options = {}) ⇒ PayoneerApi::Request constructor
- #perform ⇒ Hash
- #perform_with_object(klass) ⇒ Object
Constructor Details
#initialize(client, request_method, options = {}) ⇒ PayoneerApi::Request
9 10 11 12 13 |
# File 'lib/payoneer_api/request.rb', line 9 def initialize(client, request_method, = {}) @client = client @request_method = request_method.to_sym @options = end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
3 4 5 |
# File 'lib/payoneer_api/request.rb', line 3 def client @client end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/payoneer_api/request.rb', line 3 def @options end |
#request_method ⇒ Object
Returns the value of attribute request_method.
3 4 5 |
# File 'lib/payoneer_api/request.rb', line 3 def request_method @request_method end |
Instance Method Details
#perform ⇒ Hash
16 17 18 |
# File 'lib/payoneer_api/request.rb', line 16 def perform PayoneerApi::Response.new(@client.send("#{@request_method.to_s}_api_call".to_sym, @options)).body end |
#perform_with_object(klass) ⇒ Object
23 24 25 |
# File 'lib/payoneer_api/request.rb', line 23 def perform_with_object(klass) klass.new(perform) end |