Module: YellowApi::Client::Request
- Included in:
- YellowApi::Client
- Defined in:
- lib/yellow_api/client/request.rb
Instance Method Summary (collapse)
- - (Object) get(path, options = {})
- - (Object) request(method, path, options)
-
- (Object) uid
generates a UUID for a given instance.
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, ={}) # stuff that's sent with every request # but define by api initialization [:apikey] = apikey [:fmt] = fmt [:UID] = uid request(:get, path, ) 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, ) response = connection.send(method) do |request| request.url(path, ) 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 |