Sha256: 3b2f9466a06adf51dfd796d5dea281710bd1faeed789258480a82ce510943849

Contents?: true

Size: 263 Bytes

Versions: 12

Compression:

Stored size: 263 Bytes

Contents

# encoding: UTF-8

require 'rubygems'
require 'yajl'
require 'stringio'

unless string = ARGV[0]
  puts "\nUsage: ruby examples/from_string.rb '{\"foo\": 1145}'\n\n"
  exit(0)
end

json = StringIO.new(string)

hash = Yajl::Parser.new.parse(json)
puts hash.inspect

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
brianmario-yajl-ruby-0.5.0 examples/parsing/from_string.rb
brianmario-yajl-ruby-0.5.1 examples/parsing/from_string.rb
brianmario-yajl-ruby-0.5.2 examples/parsing/from_string.rb
brianmario-yajl-ruby-0.5.3 examples/parsing/from_string.rb
brianmario-yajl-ruby-0.5.4 examples/parsing/from_string.rb
brianmario-yajl-ruby-0.5.5 examples/parsing/from_string.rb
brianmario-yajl-ruby-0.5.6 examples/parsing/from_string.rb
brianmario-yajl-ruby-0.5.7 examples/parsing/from_string.rb
oortle-yajl-ruby-0.5.8 examples/parsing/from_string.rb
yajl-ruby-0.5.5 examples/parsing/from_string.rb
yajl-ruby-0.5.6 examples/parsing/from_string.rb
yajl-ruby-0.5.7 examples/parsing/from_string.rb