class Struct
def to_json(*args)
{"json_class":"Struct","t":{'name':'Rowdy',"age":null}}
Output:
puts Struct::Customer.new.to_json
Customer = Struct.new('Customer', :name, :address, :zip)
require 'json/add/struct'
Returns a JSON string representing +self+:
def to_json(*args) as_json.to_json(*args) end