lib/yajl.rb in yajl-ruby-1.1.0 vs lib/yajl.rb in yajl-ruby-1.2.0
- old
+ new
@@ -10,10 +10,11 @@
# = Yajl
#
# Ruby bindings to the excellent Yajl (Yet Another JSON Parser) ANSI C library.
module Yajl
+
# For compatibility, has the same signature of Yajl::Parser.parse
def self.load(str_or_io, options={}, read_bufsize=nil, &block)
Parser.parse(str_or_io, options, read_bufsize, &block)
end
@@ -63,10 +64,10 @@
options = {}
io = nil
args.each do |arg|
if arg.is_a?(Hash)
options = arg
- elsif arg.respond_to?(:read)
+ elsif arg.respond_to?(:write)
io = arg
end
end if args.any?
new(options).encode(obj, io, &block)
end
\ No newline at end of file