maik / xml-simple

Easy API for working with XML documents
MIT License
88 stars 27 forks source link

Conversions support #2

Closed romanbsd closed 13 years ago

romanbsd commented 13 years ago

Allows things like:

conversions = {
  /^total|failed$/ => lambda{|v| v.to_i},
  /^status$/ => lambda {|v| v.downcase}
}

XmlSimple.xml_in(file, :conversions => conversions)

maik commented 13 years ago

Thank you very much for your suggestion and especially for the tests! I have accepted your pull request and I have release a new version of the gem already. I'll update the documentation soon!

Cheers, Maik

On Jun 10, 2011, at 1:03 PM, romanbsd wrote:

Allows things like:

conversions = { /^total|failed$/ => lambda{|v| v.to_i}, /^status$/ => lambda {|v| v.downcase} }

XmlSimple.xml_in(file, :conversions => conversions)

Reply to this email directly or view it on GitHub: https://github.com/maik/xml-simple/pull/2