Class: BlueBank::Client
- Inherits:
-
Object
- Object
- BlueBank::Client
- Defined in:
- lib/blue_bank/client.rb
Instance Method Summary collapse
- #customer ⇒ Object
- #get(path) ⇒ Object
-
#initialize(subscriber_key:) ⇒ Client
constructor
A new instance of Client.
- #post(path:, json:) ⇒ Object
Constructor Details
#initialize(subscriber_key:) ⇒ Client
Returns a new instance of Client.
6 7 8 |
# File 'lib/blue_bank/client.rb', line 6 def initialize(subscriber_key:) @subscriber_key = subscriber_key end |
Instance Method Details
#customer ⇒ Object
18 19 20 |
# File 'lib/blue_bank/client.rb', line 18 def customer @customer ||= Customer.new(client: self) end |
#get(path) ⇒ Object
10 11 12 |
# File 'lib/blue_bank/client.rb', line 10 def get(path) JSON.parse(adapter.get(base_url + path, request_headers)) end |
#post(path:, json:) ⇒ Object
14 15 16 |
# File 'lib/blue_bank/client.rb', line 14 def post(path:, json:) JSON.parse(adapter.post(base_url + path, JSON.dump(json), request_headers)) end |