Class: Bunq::SessionServers

Inherits:
Object
  • Object
show all
Defined in:
lib/bunq/session_servers.rb

Overview

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ SessionServers

Returns a new instance of SessionServers.



5
6
7
8
# File 'lib/bunq/session_servers.rb', line 5

def initialize(client)
  @resource = Bunq::Resource.new(client, "/v1/session-server")
  @api_key = client.configuration.api_key
end

Instance Method Details

#createObject



12
13
14
15
# File 'lib/bunq/session_servers.rb', line 12

def create
  fail 'Cannot create session, please add the api_key to your configuration' unless @api_key
  @resource.post(secret: @api_key)['Response']
end