How to convert a ruby hash object to JSON?
One of the numerous niceties of Ruby is the possibility to extend existing classes with your own methods. That’s called “class reopening” or monkey-patching (the meaning of the latter can vary, though). So, take a look here: car = {:make => “bmw”, :year => “2003”} # => {:make=>”bmw”, :year=>”2003″} car.to_json # NoMethodError: undefined method `to_json’ … Read more