diff options
-rw-r--r-- | lib/ffi_yajl/parser.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ffi_yajl/parser.rb b/lib/ffi_yajl/parser.rb index b6c8ce2..380604f 100644 --- a/lib/ffi_yajl/parser.rb +++ b/lib/ffi_yajl/parser.rb @@ -31,6 +31,8 @@ module FFI_Yajl end def parse(str) + raise FFI_Yajl::ParseError, "input must be a string or IO" unless str.is_a?(String) || str.respond_to?(:read) + # initialization that we can do in pure ruby yajl_opts = {} |