Class: ExmoApi::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/exmo_api/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_method, params = {}) ⇒ Request

Returns a new instance of Request.



12
13
14
15
# File 'lib/exmo_api/request.rb', line 12

def initialize(api_method, params = {})
  @api_method = api_method
  @params = params
end

Instance Attribute Details

#api_methodObject (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

#config=(value) ⇒ Object

Sets the attribute config

Parameters:

  • value

    the value to set the attribute config to.



10
11
12
# File 'lib/exmo_api/request.rb', line 10

def config=(value)
  @config = value
end

Instance Method Details

#performObject



17
18
19
# File 'lib/exmo_api/request.rb', line 17

def perform
  JSON.parse response.body.to_s
end

#responseObject



21
22
23
# File 'lib/exmo_api/request.rb', line 21

def response
  @response ||= http.request(build_request)
end