Class: ExmoApi::Request
- Inherits:
-
Object
- Object
- ExmoApi::Request
- Defined in:
- lib/exmo_api/request.rb
Instance Attribute Summary collapse
-
#api_method ⇒ Object
readonly
Returns the value of attribute api_method.
Instance Method Summary collapse
-
#initialize(api_method, params = {}) ⇒ Request
constructor
A new instance of Request.
- #perform ⇒ Object
- #response ⇒ Object
Constructor Details
#initialize(api_method, params = {}) ⇒ Request
Returns a new instance of Request.
11 12 13 14 |
# File 'lib/exmo_api/request.rb', line 11 def initialize(api_method, params = {}) @api_method = api_method @params = params end |
Instance Attribute Details
#api_method ⇒ Object (readonly)
Returns the value of attribute api_method.
9 10 11 |
# File 'lib/exmo_api/request.rb', line 9 def api_method @api_method end |
Instance Method Details
#perform ⇒ Object
16 17 18 |
# File 'lib/exmo_api/request.rb', line 16 def perform JSON.parse response.body.to_s end |
#response ⇒ Object
20 21 22 |
# File 'lib/exmo_api/request.rb', line 20 def response @response ||= http.request(build_request) end |