Module: YellowApi::Client::Request

Included in:
YellowApi::Client
Defined in:
lib/yellow_api/client/request.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) get(path, options = {})



13
14
15
16
17
18
19
20
21
# File 'lib/yellow_api/client/request.rb', line 13

def get(path, options={})
  # stuff that's sent with every request
  # but define by api initialization
  options[:apikey] = apikey
  options[:fmt] = fmt
  options[:UID] = uid
  
  request(:get, path, options)
end

- (Object) request(method, path, options)



23
24
25
26
27
28
# File 'lib/yellow_api/client/request.rb', line 23

def request(method, path, options)
  response = connection.send(method) do |request|
    request.url(path, options)
  end
  response.body
end

- (Object) uid

generates a UUID for a given instance



9
10
11
# File 'lib/yellow_api/client/request.rb', line 9

def uid
  @uid ||= UUID.new.generate(:compact)
end