Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 493 Bytes

README.md

File metadata and controls

16 lines (11 loc) · 493 Bytes

CompactData Example in Ruby

A very basic Ruby example importing the RubyGem and using puts to output to console, using the two methods parse and generate. Source code for compactdata-ruby available on GitHub

require "compactdata"

puts CompactData.parse("foo=bar")
# -> {"foo"=>"bar"}

test_obj = Hash.new
test_obj["foo"] = "bar"

puts CompactData.generate(test_obj)
# -> foo=bar