title: How to convert a Ruby object to JSON
body: <p>I would like to do something like this:</p>
  
  <pre><code>require 'json'
  
  class Person
  attr_accessor :fname, :lname
  end
  
  p = Person.new
  p.fname = "Mike"
  p.lname = "Smith"
  
  p.to_json
  </code></pre>
  
  <p>Is it possible?</p>