class Blinksale::Client

Attributes

address1[RW]
address2[RW]
city[RW]
country[RW]
name[RW]
phone[RW]
state[RW]
zip_code[RW]

Public Class Methods

from_node(node) click to toggle source
# 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