Class: Uncomtrade::Request

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

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Request

Returns a new instance of Request.



5
6
7
8
# File 'lib/uncomtrade/request.rb', line 5

def initialize(opts={})
  @options = Options.new(opts)
  @query = Query.new
end

Instance Method Details

#get_dataObject



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

def get_data
  http_response = query.get_data(options.list_options)
  Response.new(http_response)
end

#paramsObject



25
26
27
# File 'lib/uncomtrade/request.rb', line 25

def params
  options.list_options
end

#resetObject



15
16
17
18
# File 'lib/uncomtrade/request.rb', line 15

def reset
  options.reset
  self
end

#update(opts = {}) ⇒ Object



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

def update(opts={})
  options.update(opts)
  self
end