Class: BunqRb::CashRegister
- Inherits:
-
Object
- Object
- BunqRb::CashRegister
- Includes:
- Shared
- Defined in:
- lib/bunq_rb/objects/cash_register.rb
Overview
CashRegister
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
- .create(hsh = {}, user_id, monetary_account_id) ⇒ Object
- .url(user_id, monetary_account_id) ⇒ Object
Instance Method Summary collapse
-
#initialize(hsh = {}) ⇒ CashRegister
constructor
A new instance of CashRegister.
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
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/bunq_rb/objects/cash_register.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/bunq_rb/objects/cash_register.rb', line 8 def name @name end |
#status ⇒ Object (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, monetary_account_id) uri = url(user_id, monetary_account_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, monetary_account_id) "/v1/user/#{user_id}/monetary-account/#{monetary_account_id}/cash-register" end |