Class: Ghub::API::Client
- Inherits:
-
Object
- Object
- Ghub::API::Client
- Defined in:
- lib/ghub/api/client.rb
Overview
A low-level API client.
Instance Method Summary collapse
- #delete(path, **parameters) ⇒ Object
- #get(path, **parameters) ⇒ Object
-
#initialize(page: Page) ⇒ Client
constructor
A new instance of Client.
- #patch(path, body = nil, **parameters) ⇒ Object
- #post(path, body = nil, **parameters) ⇒ Object
- #put(path, body = nil, **parameters) ⇒ Object
Constructor Details
Instance Method Details
#delete(path, **parameters) ⇒ Object
35 |
# File 'lib/ghub/api/client.rb', line 35 def delete(path, **parameters) = call __method__, path, params: parameters |
#get(path, **parameters) ⇒ Object
17 18 19 20 21 |
# File 'lib/ghub/api/client.rb', line 17 def get path, **parameters return call __method__, path, params: parameters unless configuration.paginate page.of { |index| call __method__, path, params: parameters.merge(page: index) } end |
#patch(path, body = nil, **parameters) ⇒ Object
31 32 33 |
# File 'lib/ghub/api/client.rb', line 31 def patch path, body = nil, **parameters call __method__, path, json: body, params: parameters end |
#post(path, body = nil, **parameters) ⇒ Object
23 24 25 |
# File 'lib/ghub/api/client.rb', line 23 def post path, body = nil, **parameters call __method__, path, json: body, params: parameters end |
#put(path, body = nil, **parameters) ⇒ Object
27 28 29 |
# File 'lib/ghub/api/client.rb', line 27 def put path, body = nil, **parameters call __method__, path, json: body, params: parameters end |