Class: Arin::RWS::Org

Inherits:
Object
  • Object
show all
Defined in:
lib/arin-rws/org.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cityObject

Returns the value of attribute city.



4
5
6
# File 'lib/arin-rws/org.rb', line 4

def city
  @city
end

#handleObject

Returns the value of attribute handle.



4
5
6
# File 'lib/arin-rws/org.rb', line 4

def handle
  @handle
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/arin-rws/org.rb', line 4

def name
  @name
end

#postal_codeObject

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_dateObject

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_addressObject

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

#netsObject



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