Project

kvx

0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
Kvx (Keys, Values, and XML) makes it convenient to store and retrieve the simplest of data as plain text using a hash-like format or as XML.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Project Readme

Introducing the Kvx gem

Reading a Hash object

require 'kvx'

kvx = Kvx.new({:fun => '123', :apple => 'red'})

puts kvx.to_xml

Output:

<?xml version='1.0' encoding='UTF-8'?>
<kvx>
  <fun>123</fun>
  <apple>red</apple>
</kvx>
s =<<EOF
<kvx>
  <fun>123</fun>
  <apple>red</apple>
</kvx>
EOF

h = Kvx.new(Rexle.new(s).root).to_h
#=> {"kvx"=>{"fun"=>"123", "apple"=>"red"}} 

Resource

kvx gem