Class: BunqRb::PermittedIp
- Inherits:
-
Object
- Object
- BunqRb::PermittedIp
- Includes:
- Shared
- Defined in:
- lib/bunq_rb/objects/permitted_ip.rb
Overview
PermittedIp
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
- .create(hsh = {}, user_id, credential_password_id) ⇒ Object
- .url(user_id, credential_password_id) ⇒ Object
Instance Method Summary collapse
-
#initialize(hsh = {}) ⇒ PermittedIp
constructor
A new instance of PermittedIp.
- #update(hsh = {}, user_id, credential_password_id) ⇒ Object
Constructor Details
#initialize(hsh = {}) ⇒ PermittedIp
Returns a new instance of PermittedIp.
10 11 12 13 14 |
# File 'lib/bunq_rb/objects/permitted_ip.rb', line 10 def initialize(hsh = {}) @id = hsh["id"] @ip = hsh["ip"] @status = hsh["status"] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/bunq_rb/objects/permitted_ip.rb', line 8 def id @id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
8 9 10 |
# File 'lib/bunq_rb/objects/permitted_ip.rb', line 8 def ip @ip end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/bunq_rb/objects/permitted_ip.rb', line 8 def status @status end |
Class Method Details
.create(hsh = {}, user_id, credential_password_id) ⇒ Object
20 21 22 23 24 |
# 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 |
.url(user_id, credential_password_id) ⇒ Object
16 17 18 |
# 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 |
Instance Method Details
#update(hsh = {}, user_id, credential_password_id) ⇒ Object
26 27 28 29 30 31 |
# 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 |