Class: CFC::API
- Inherits:
-
Object
- Object
- CFC::API
- Defined in:
- lib/cfc/api.rb
Instance Method Summary collapse
- #get(path, params: nil, headers: nil, cache: true, expiry: nil) ⇒ Object
- #get_json(path, params: nil, headers: nil, cache: true, expiry: nil) ⇒ Object
-
#initialize ⇒ API
constructor
A new instance of API.
Constructor Details
Instance Method Details
#get(path, params: nil, headers: nil, cache: true, expiry: nil) ⇒ Object
16 17 18 |
# File 'lib/cfc/api.rb', line 16 def get(path, params: nil, headers: nil, cache: true, expiry: nil) request(Net::HTTP::Get, build_uri(path, params), headers: headers, cache: cache, expiry: expiry) end |
#get_json(path, params: nil, headers: nil, cache: true, expiry: nil) ⇒ Object
20 21 22 |
# File 'lib/cfc/api.rb', line 20 def get_json(path, params: nil, headers: nil, cache: true, expiry: nil) request_json(Net::HTTP::Get, build_uri(path, params), headers: headers, cache: cache, expiry: expiry) end |