Class: BunqRb::Installation

Inherits:
Object
  • Object
show all
Includes:
Shared
Defined in:
lib/bunq_rb/objects/installation.rb

Overview

Installation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hsh = {}) ⇒ Installation

Returns a new instance of Installation.



10
11
12
# File 'lib/bunq_rb/objects/installation.rb', line 10

def initialize(hsh = {})
  @id = hsh["id"]
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/bunq_rb/objects/installation.rb', line 8

def id
  @id
end

Class Method Details

.create(hash = {}) ⇒ Object



19
20
21
22
# File 'lib/bunq_rb/objects/installation.rb', line 19

def self.create(hash = {})
  response = Client.send_method(:post, url, hash)
  [new(response[0]["Id"]), response[1]["Token"], response[2]["ServerPublicKey"]]
end

.urlObject



24
25
26
# File 'lib/bunq_rb/objects/installation.rb', line 24

def self.url
  "/v1/installation"
end

Instance Method Details

#server_public_keyObject



14
15
16
17
# File 'lib/bunq_rb/objects/installation.rb', line 14

def server_public_key
  @server_public_key ||= BunqRb::InstallationServerPublicKey.new(installation_id: @id)
  @server_public_key.all.first
end