Class: Blinksale::Client
- Inherits:
-
Object
- Object
- Blinksale::Client
- Defined in:
- lib/clients.rb
Instance Attribute Summary collapse
-
#address1 ⇒ Object
Returns the value of attribute address1.
-
#address2 ⇒ Object
Returns the value of attribute address2.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#state ⇒ Object
Returns the value of attribute state.
-
#zip_code ⇒ Object
Returns the value of attribute zip_code.
Class Method Summary collapse
Instance Attribute Details
#address1 ⇒ Object
Returns the value of attribute address1.
5 6 7 |
# File 'lib/clients.rb', line 5 def address1 @address1 end |
#address2 ⇒ Object
Returns the value of attribute address2.
5 6 7 |
# File 'lib/clients.rb', line 5 def address2 @address2 end |
#city ⇒ Object
Returns the value of attribute city.
5 6 7 |
# File 'lib/clients.rb', line 5 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
5 6 7 |
# File 'lib/clients.rb', line 5 def country @country end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/clients.rb', line 5 def name @name end |
#phone ⇒ Object
Returns the value of attribute phone.
5 6 7 |
# File 'lib/clients.rb', line 5 def phone @phone end |
#state ⇒ Object
Returns the value of attribute state.
5 6 7 |
# File 'lib/clients.rb', line 5 def state @state end |
#zip_code ⇒ Object
Returns the value of attribute zip_code.
5 6 7 |
# File 'lib/clients.rb', line 5 def zip_code @zip_code end |
Class Method Details
.from_node(node) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/clients.rb', line 7 def self.from_node(node) self.new.tap do |i| i.id = node.attributes["uri"].content[/\d+$/].to_i i.name = node.xpath('xmlns:name').first.content i.address1 = node.xpath("xmlns:address1").first.content.to_f i.address2 = node.xpath("xmlns:address2").first.content.to_f i.city = node.xpath("xmlns:city").first.content.to_f i.state = node.xpath("xmlns:state").first.content.to_f i.zip_code = node.xpath("xmlns:zip").first.content.to_f i.country = node.xpath("xmlns:country").first.content.to_f i.phone = node.xpath("xmlns:phone").first.content.to_f end end |