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.



7
8
9
10
# File 'lib/bunq/session_servers.rb', line 7

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

Instance Method Details

#createObject



14
15
16
17
18
# File 'lib/bunq/session_servers.rb', line 14

def create
  fail 'Cannot create session, please add the api_key to your configuration' unless @api_key

  @resource.post({secret: @api_key})['Response']
end