Class: Arin::RWS::Org
- Inherits:
-
Object
- Object
- Arin::RWS::Org
- Defined in:
- lib/arin-rws/org.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#handle ⇒ Object
Returns the value of attribute handle.
-
#name ⇒ Object
Returns the value of attribute name.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#registration_date ⇒ Object
Returns the value of attribute registration_date.
-
#street_address ⇒ Object
Returns the value of attribute street_address.
Instance Method Summary collapse
-
#initialize(data) ⇒ Org
constructor
A new instance of Org.
- #nets ⇒ Object
Constructor Details
#initialize(data) ⇒ Org
Returns a new instance of Org.
6 7 8 9 10 11 12 |
# File 'lib/arin-rws/org.rb', line 6 def initialize(data) self.name = data['org']['name']['$'] self.handle = data['org']['handle']['$'] self.city = data['org']['city']['$'] self.postal_code = data['org']['postalCode']['$'] self.registration_date = DateTime.parse(data['org']['registrationDate']['$']) end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
4 5 6 |
# File 'lib/arin-rws/org.rb', line 4 def city @city end |
#handle ⇒ Object
Returns the value of attribute handle.
4 5 6 |
# File 'lib/arin-rws/org.rb', line 4 def handle @handle end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/arin-rws/org.rb', line 4 def name @name end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
4 5 6 |
# File 'lib/arin-rws/org.rb', line 4 def postal_code @postal_code end |
#registration_date ⇒ Object
Returns the value of attribute registration_date.
4 5 6 |
# File 'lib/arin-rws/org.rb', line 4 def registration_date @registration_date end |
#street_address ⇒ Object
Returns the value of attribute street_address.
4 5 6 |
# File 'lib/arin-rws/org.rb', line 4 def street_address @street_address end |
Instance Method Details
#nets ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/arin-rws/org.rb', line 14 def nets @networks = [] r = Arin::RWS::Client.query("org/#{self.handle}/nets.json") r['nets']['netRef'].each do |n| j = Arin::RWS::Client.query("net/#{n['@handle']}.json") @networks << Arin::RWS::Network.new(j) end @networks end |