Class: Arin::RWS::Customer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Customer

Returns a new instance of Customer.



6
7
8
9
10
11
12
13
14
# File 'lib/arin-rws/customer.rb', line 6

def initialize(data)
	self.name = data['customer']['name']['$']
	self.handle = data['customer']['handle']['$']
	self.city = data['customer']['city']['$']
	self.postal_code = data['customer']['postalCode']['$']
	self.registration_date = DateTime.parse(data['customer']['registrationDate']['$'])

	@parent_org_handle = data['customer']['parentOrgRef']['@handle']
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



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

def city
  @city
end

#handleObject

Returns the value of attribute handle.



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

def handle
  @handle
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#postal_codeObject

Returns the value of attribute postal_code.



4
5
6
# File 'lib/arin-rws/customer.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/customer.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/customer.rb', line 4

def street_address
  @street_address
end

Instance Method Details

#parent_orgObject



16
17
18
19
# File 'lib/arin-rws/customer.rb', line 16

def parent_org
	r = Arin::RWS::Client.query("org/#{@parent_org_handle}.json")
	Arin::RWS::Org.new(r)
end