Sha256: e7fe89a3467d8affa45ccf2dd835f5396d892f6f5bdbd99d0d96076c24acb8e1

Contents?: true

Size: 620 Bytes

Versions: 44

Compression:

Stored size: 620 Bytes

Contents

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

$: << File.dirname(__FILE__)

require 'helper'

class Handler
  def initialize
    @state = []
  end

  def hash_start
    @state << {}
    @state.last
  end

  def hash_end
    @state.pop
  end

  def hash_set(h,k,v)
    h.store(k,v)
  end

  def array_start
    @state << []
    @state.last
  end


  def array_end
    @state.pop
  end

  def array_append(a,v)
    a << v
  end

  def error(message, line, column); p "ERROR: #{message}" end
end

handler = Handler.new
def handler.add_value(v)
  p v
end

Oj.sc_parse(handler, StringIO.new('{"a":"b","c":[1,2,{"d":"e"}]}[4,5,6]'))

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
oj-3.7.6 test/io.rb
oj-2.18.5 test/io.rb
oj-2.18.4 test/io.rb
oj-2.18.3 test/io.rb
oj-2.18.2 test/io.rb
oj-2.18.1 test/io.rb
oj-2.18.0 test/io.rb
oj-2.17.5 test/io.rb
oj-2.17.3 test/io.rb
oj-2.17.2 test/io.rb
oj-2.17.1 test/io.rb
oj-2.17.0 test/io.rb
oj-2.16.1 test/io.rb
oj-2.14.6 test/io.rb
oj-2.14.5 test/io.rb
oj-2.14.4 test/io.rb
oj-2.14.3 test/io.rb
oj-2.14.2 test/io.rb
oj-2.14.1 test/io.rb
oj-2.14.0 test/io.rb