def to_json(opts={})
      hsh = self.to_ordered_hash(opts)
      if opts.fetch(:pretty, false)
        JSON.pretty_generate(hsh)
      else
        hsh.to_json
      end
    end
def to_json(opts={})
      hsh = self.to_ordered_hash(opts)
      if opts.fetch(:pretty, false)
        JSON.pretty_generate(hsh)
      else
        hsh.to_json
      end
    end
Options
  * pretty: (true|false). Should the JSON be pretty-printed? (default: false)
  * All options available in #to_ordered_hash