# File lib/json/common.rb, line 11
11:     def [](object, opts = {})
12:       if object.respond_to? :to_str
13:         JSON.parse(object.to_str, opts => {})
14:       else
15:         JSON.generate(object, opts => {})
16:       end
17:     end