= demolisher
Works in a similar fashion to Builder but is instead used for extracting information from XML files rather than building them.
== Example
Given the simple XML example file below
Enoch
Root
01234 567 8900
enoch@example.com
YES
Randy
Waterhouse
01234 567 8901
randy@example.com
NO
we can parse it with
xml = Demolisher.demolish('addressbook.xml')
xml.addressbook do
xml.person do
puts "#{xml.firstname} #{xml.lastname}: #{xml.contact.email}"
puts "this person is active" if xml.active?
end
end
and we should get the result of
Enoch Root: enoch@example.com
this person is active
Randy Waterhouse: randy@example.com
== Copyright
Copyright (c) 2009 Geoff Garside. See LICENSE for details.