summaryrefslogtreecommitdiff
path: root/lib/ffi_yajl/encoder.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-07-09 13:51:28 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-07-09 13:51:28 -0700
commitaa2afb68a78fed7a71a6d574586202a0377eba25 (patch)
tree38a1750ae150495501cfb39ade622be3822fabe3 /lib/ffi_yajl/encoder.rb
parent457842ff8567742d94cb079f439c38403a15d8b8 (diff)
downloadffi-yajl-lcg/more-cops.tar.gz
yet more copslcg/more-cops
Diffstat (limited to 'lib/ffi_yajl/encoder.rb')
-rw-r--r--lib/ffi_yajl/encoder.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ffi_yajl/encoder.rb b/lib/ffi_yajl/encoder.rb
index 9f2e564..f4dd8c8 100644
--- a/lib/ffi_yajl/encoder.rb
+++ b/lib/ffi_yajl/encoder.rb
@@ -41,7 +41,7 @@ module FFI_Yajl
# call either the ext or ffi hook
str = do_yajl_encode(obj, yajl_gen_opts, opts)
# we can skip cleaning the whole string for utf-8 issues if we have yajl validate as we go
- str.encode!("utf-8", "binary", :undef => :replace) unless yajl_gen_opts[:yajl_gen_validate_utf8]
+ str.encode!("utf-8", "binary", undef: :replace) unless yajl_gen_opts[:yajl_gen_validate_utf8]
str
end
@@ -56,7 +56,7 @@ module FFI_Yajl
def self.raise_error_for_status(status, token = nil)
# scrub token to valid utf-8 since we may be issuing an exception on an invalid utf-8 token
- token = token.to_s.encode("utf-8", "binary", :undef => :replace)
+ token = token.to_s.encode("utf-8", "binary", undef: :replace)
case status
when 1 # yajl_gen_keys_must_be_strings
raise FFI_Yajl::EncodeError, "YAJL internal error: attempted use of non-string object as key"