Sha256: 1f2f730caeb9eb49266b23a8ac1a0ae5c0565e1b98044921addf8d6ce8fa35b9
Contents?: true
Size: 459 Bytes
Versions: 4
Compression:
Stored size: 459 Bytes
Contents
#!/usr/bin/env ruby $: << '.' $: << '../lib' $: << '../ext' require 'tracer' require 'oj' require 'sample' class Foo def initialize() @x = 'abc' @y = 123 @a = [{}] end def to_json() '{"x":33}' end def as_json(options={}) { z: @a, y: @y, x: @x } end end Tracer.display_c_call = true Tracer.on obj = Foo.new j = Oj.dump(obj, mode: :custom, trace: true, use_as_json: true) #puts j #Oj.load(j, mode: :rails, trace: true)
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
oj-3.6.3 | test/foo.rb |
oj-3.6.2 | test/foo.rb |
oj-3.6.0 | test/foo.rb |
oj-3.5.1 | test/foo.rb |