Class: BunqRb::CashRegister

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

Overview

CashRegister

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hsh = {}) ⇒ CashRegister

Returns a new instance of CashRegister.



10
11
12
13
14
# File 'lib/bunq_rb/objects/cash_register.rb', line 10

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

Class Method Details

.create(hsh = {}, user_id, monetary_account_id) ⇒ Object



16
17
18
19
20
# File 'lib/bunq_rb/objects/cash_register.rb', line 16

def self.create(hsh = {}, user_id, )
  uri = url(user_id, )
  response = Client.send_method(:post, uri, hsh)
  response[0]["Id"]
end

.url(user_id, monetary_account_id) ⇒ Object



22
23
24
# File 'lib/bunq_rb/objects/cash_register.rb', line 22

def self.url(user_id, )
  "/v1/user/#{user_id}/monetary-account/#{}/cash-register"
end