Class: BunqRb::Installation
- Inherits:
-
Object
- Object
- BunqRb::Installation
- Includes:
- Shared
- Defined in:
- lib/bunq_rb/objects/installation.rb
Overview
Installation
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hsh = {}) ⇒ Installation
constructor
A new instance of Installation.
- #server_public_key ⇒ Object
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
#id ⇒ Object (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 |
.url ⇒ Object
24 25 26 |
# File 'lib/bunq_rb/objects/installation.rb', line 24 def self.url "/v1/installation" end |
Instance Method Details
#server_public_key ⇒ Object
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 |