diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ffi_yajl/encoder.rb | 2 | ||||
-rw-r--r-- | lib/ffi_yajl/ffi/encoder.rb | 2 | ||||
-rw-r--r-- | lib/ffi_yajl/json_gem.rb | 18 |
3 files changed, 10 insertions, 12 deletions
diff --git a/lib/ffi_yajl/encoder.rb b/lib/ffi_yajl/encoder.rb index bd3ff31..8b5bfcb 100644 --- a/lib/ffi_yajl/encoder.rb +++ b/lib/ffi_yajl/encoder.rb @@ -18,7 +18,7 @@ module FFI_Yajl end # call either the ext or ffi hook - str = do_yajl_encode(obj, yajl_gen_opts, opts) + str = do_yajl_encode(obj, yajl_gen_opts) str.force_encoding('UTF-8') if defined? Encoding str end diff --git a/lib/ffi_yajl/ffi/encoder.rb b/lib/ffi_yajl/ffi/encoder.rb index 8837e12..bbeba27 100644 --- a/lib/ffi_yajl/ffi/encoder.rb +++ b/lib/ffi_yajl/ffi/encoder.rb @@ -4,7 +4,7 @@ require 'ffi_yajl/ffi' module FFI_Yajl module FFI module Encoder - def do_yajl_encode(obj, yajl_gen_opts = {}, opts) + def do_yajl_encode(obj, yajl_gen_opts = {}) yajl_gen = FFI_Yajl.yajl_gen_alloc(nil); diff --git a/lib/ffi_yajl/json_gem.rb b/lib/ffi_yajl/json_gem.rb index 4773f7f..0e64d50 100644 --- a/lib/ffi_yajl/json_gem.rb +++ b/lib/ffi_yajl/json_gem.rb @@ -25,8 +25,6 @@ module JSON options_map = {} options_map[:pretty] = true options_map[:indent] = opts[:indent] if opts.has_key?(:indent) - require 'pp' - pp options_map FFI_Yajl::Encoder.encode(obj, options_map).chomp rescue FFI_Yajl::EncodeError => e raise JSON::GeneratorError, e.message @@ -57,49 +55,49 @@ end class Array def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class Hash def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class Fixnum def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class Float def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class String def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class TrueClass def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class FalseClass def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class NilClass def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end |