xml_converter v0.4.0
XMLConverter
Create hashes from XML documents easily.
xml_converter
is heavily inspired by ActiveSupport::XMLConverter.
Installation
-
Add the dependency to your
shard.yml
:dependencies: xml_converter: github: mamantoha/xml_converter
-
Run
shards install
Usage
require "xml_converter"
xml = <<-XML
<person id="1">
<firstName preferredName="Jane">Jehanne</firstname>
<lastName>Doe</lastname>
</person>
XML
document = XML.parse(xml)
hash = XMLConverter.new(document).to_h
# => {"person" => {"id" => "1", "firstName" => {"preferredName" => "Jane", :value => "Jehanne"}, "lastName" => "Doe"}}
Contributing
- Fork it (https://github.com/mamantoha/xml_converter/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Anton Maminov - creator and maintainer
Repository
xml_converter
Owner
Statistic
- 8
- 0
- 0
- 2
- 0
- over 3 years ago
- November 25, 2018
License
MIT License
Links
Synced at
Sat, 23 Nov 2024 15:33:51 GMT
Languages