class BunqRb::TabUsageSingle

TabUsageSingle

Attributes

uuid[R]

Public Class Methods

create(hash = {}, user_id, monetary_account_id, cash_register_id) click to toggle source
# File lib/bunq_rb/objects/tab_usage_single.rb, line 14
def self.create(hash = {}, user_id, monetary_account_id, cash_register_id)
  response = Client.send_method(:post, uri(user_id, monetary_account_id, cash_register_id), hash)
  new(response[0]["Uuid"])
end
new(hsh = {}) click to toggle source
# File lib/bunq_rb/objects/tab_usage_single.rb, line 6
def initialize(hsh = {})
  @uuid = hsh["uuid"]
end
uri(user_id, monetary_account_id, cash_register_id) click to toggle source
# File lib/bunq_rb/objects/tab_usage_single.rb, line 10
def self.uri(user_id, monetary_account_id, cash_register_id)
  "/v1/user/#{user_id}/monetary-account/#{monetary_account_id}/cash-register/#{cash_register_id}/tab-usage-single"
end

Public Instance Methods

update(hsh = {}, user_id, monetary_account_id, cash_register_id) click to toggle source
# File lib/bunq_rb/objects/tab_usage_single.rb, line 19
def update(hsh = {}, user_id, monetary_account_id, cash_register_id)
  url = self.class.uri(user_id, monetary_account_id, cash_register_id)
  full_path = [url, uuid].join("/")
  response = Client.send_method(:put, full_path, hsh)
  response[0]["Uuid"]
end