Sha256: 7f3af47fad0ab1fb95a72efb0ee1952229078ce266ced8c9fb54423ef30952ca

Contents?: true

Size: 370 Bytes

Versions: 1

Compression:

Stored size: 370 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

$: << File.join(File.dirname(__FILE__), "../lib")
$: << File.join(File.dirname(__FILE__), "../ext")

require 'oj'

class A < BasicObject
  def initialize(data)
    @data = data
  end
end

a = A.new("xyz")

json = Oj.dump(a, mode: :compat, use_to_json: true)
#=> NoMethodError: undefined method `to_hash' for #<A:0x007fae03de1dc8>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oj-2.18.1 test/foo.rb