class BunqRb::PermittedIp

PermittedIp

Attributes

id[R]
ip[R]
status[R]

Public Class Methods

create(hsh = {}, user_id, credential_password_id) click to toggle source
# File lib/bunq_rb/objects/permitted_ip.rb, line 20
def self.create(hsh = {}, user_id, credential_password_id)
  uri = url(user_id, credential_password_id)
  response = Client.send_method(:post, uri, hsh)
  response[0]["Id"]
end
new(hsh = {}) click to toggle source
# File lib/bunq_rb/objects/permitted_ip.rb, line 10
def initialize(hsh = {})
  @id = hsh["id"]
  @ip = hsh["ip"]
  @status = hsh["status"]
end
url(user_id, credential_password_id) click to toggle source
# File lib/bunq_rb/objects/permitted_ip.rb, line 16
def self.url(user_id, credential_password_id)
  "/v1/user/#{user_id}/credential-password-ip/#{credential_password_id}/ip"
end

Public Instance Methods

update(hsh = {}, user_id, credential_password_id) click to toggle source
# File lib/bunq_rb/objects/permitted_ip.rb, line 26
def update(hsh = {}, user_id, credential_password_id)
  uri = self.class.url(user_id, credential_password_id)
  full_path = [uri, id].join("/")
  response = Client.send_method(:put, full_path, hsh)
  response[0]["Id"]
end