Class: BridgeBankin::API::Client
- Inherits:
-
Object
- Object
- BridgeBankin::API::Client
- Defined in:
- lib/bridge_bankin/api/client.rb
Overview
Allows to request the Bridge API using Ruby native net/http library
Constant Summary collapse
- HTTP_VERBS_MAP =
{ get: Net::HTTP::Get, post: Net::HTTP::Post, put: Net::HTTP::Put, delete: Net::HTTP::Delete }.freeze
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
Instance Method Summary collapse
-
#delete(path, **params) ⇒ Hash
Handles a DELETE request.
-
#get(path, **params) ⇒ Hash
Handles a GET request.
-
#post(path, **params) ⇒ Hash
Handles a POST request.
-
#put(path, **params) ⇒ Hash
Handles a PUT request.
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
22 23 24 |
# File 'lib/bridge_bankin/api/client.rb', line 22 def access_token @access_token end |
Instance Method Details
#delete(path, **params) ⇒ Hash
Handles a DELETE request
74 75 76 |
# File 'lib/bridge_bankin/api/client.rb', line 74 def delete(path, **params) request :delete, path, params end |
#get(path, **params) ⇒ Hash
Handles a GET request
34 35 36 |
# File 'lib/bridge_bankin/api/client.rb', line 34 def get(path, **params) request :get, path, params end |
#post(path, **params) ⇒ Hash
Handles a POST request
48 49 50 |
# File 'lib/bridge_bankin/api/client.rb', line 48 def post(path, **params) request :post, path, params end |
#put(path, **params) ⇒ Hash
Handles a PUT request
61 62 63 |
# File 'lib/bridge_bankin/api/client.rb', line 61 def put(path, **params) request :put, path, params end |