Class: Petfinder::Shelter

Inherits:
Object
  • Object
show all
Extended by:
XmlMapper
Defined in:
lib/petfinder/shelter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from XmlMapper

camel_case_lower, xml_attribute, xml_attributes

Constructor Details

#initialize(xml) ⇒ Shelter

Returns a new instance of Shelter.



8
9
10
# File 'lib/petfinder/shelter.rb', line 8

def initialize(xml)
  @xml = xml
end

Class Method Details

.multiple(xml) ⇒ Object



12
13
14
15
16
# File 'lib/petfinder/shelter.rb', line 12

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