Class: MonogotoApi::IP
- Inherits:
-
Object
- Object
- MonogotoApi::IP
- Defined in:
- lib/monogoto_api/ip.rb
Instance Attribute Summary collapse
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#ip_allocation_policy ⇒ Object
readonly
Returns the value of attribute ip_allocation_policy.
-
#ip_lock ⇒ Object
readonly
Returns the value of attribute ip_lock.
-
#ipv_type ⇒ Object
readonly
Returns the value of attribute ipv_type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ IP
constructor
A new instance of IP.
Constructor Details
#initialize(**attributes) ⇒ IP
Returns a new instance of IP.
7 8 9 10 11 12 |
# File 'lib/monogoto_api/ip.rb', line 7 def initialize(**attributes) @ip = attributes[:ip] @ip_allocation_policy = attributes[:ip_allocation_policy] @ip_lock = attributes[:ip_lock] @ipv_type = attributes[:ipv_type] end |
Instance Attribute Details
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
5 6 7 |
# File 'lib/monogoto_api/ip.rb', line 5 def ip @ip end |
#ip_allocation_policy ⇒ Object (readonly)
Returns the value of attribute ip_allocation_policy.
5 6 7 |
# File 'lib/monogoto_api/ip.rb', line 5 def ip_allocation_policy @ip_allocation_policy end |
#ip_lock ⇒ Object (readonly)
Returns the value of attribute ip_lock.
5 6 7 |
# File 'lib/monogoto_api/ip.rb', line 5 def ip_lock @ip_lock end |
#ipv_type ⇒ Object (readonly)
Returns the value of attribute ipv_type.
5 6 7 |
# File 'lib/monogoto_api/ip.rb', line 5 def ipv_type @ipv_type end |
Class Method Details
.parse(hash_ip) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/monogoto_api/ip.rb', line 22 def self.parse(hash_ip) new( ip: hash_ip["IP"], ip_allocation_policy: hash_ip["IPAllocationPolicy"], ip_lock: hash_ip["IPLock"], ipv_type: hash_ip["IPvType"] ) end |
.parse_many(response) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/monogoto_api/ip.rb', line 14 def self.parse_many(response) output = [] response.each do |pre_ip| output.push(parse(pre_ip)) end output end |