Sha256: 278f0ed22e421147606e1d55c2ce0392f9a33dc6c36ad68c95796fe74ab0c3ad

Contents?: true

Size: 396 Bytes

Versions: 3

Compression:

Stored size: 396 Bytes

Contents

module Petfinder
  class Shelter
    extend XmlMapper

    xml_attributes :id, :name, :address1, :address2, :city, :state, :zip, :country,
      :latitude, :longitude, :phone, :fax, :email

    def initialize(xml)
      @xml = xml
    end

    def self.multiple(xml)
      xml.xpath("//shelters/shelter").map do |node|
        Shelter.new(Nokogiri::XML(node.to_xml))
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
petfinder-1.0.2 lib/petfinder/shelter.rb
petfinder-1.0.1 lib/petfinder/shelter.rb
petfinder-1.0.0 lib/petfinder/shelter.rb