Class: BlueBank::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/blue_bank/client.rb

Instance Method Summary collapse

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

#customerObject



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