From aa80a0441ef24dc9b6278a6ae1bb44a42d7d19de Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Wed, 21 Jun 2017 12:26:09 -0700 Subject: remove duplicated code Signed-off-by: Lamont Granquist --- lib/ffi_yajl/ffi/encoder.rb | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'lib') diff --git a/lib/ffi_yajl/ffi/encoder.rb b/lib/ffi_yajl/ffi/encoder.rb index f35f3c4..62b2c96 100644 --- a/lib/ffi_yajl/ffi/encoder.rb +++ b/lib/ffi_yajl/ffi/encoder.rb @@ -1,5 +1,5 @@ # Copyright (c) 2015 Lamont Granquist -# Copyright (c) 2015 Chef Software, Inc. +# Copyright (c) 2015-2017, Chef Software Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -155,24 +155,6 @@ class FalseClass end end -class Integer - def ffi_yajl(yajl_gen, state) - str = to_s - if str == "NaN" || str == "Infinity" || str == "-Infinity" - raise ::FFI_Yajl::EncodeError, "'#{str}' is an invalid number" - end - if state[:processing_key] - if ( status = FFI_Yajl.yajl_gen_string(yajl_gen, str, str.bytesize) ) != 0 - FFI_Yajl::Encoder.raise_error_for_status(status, str) - end - else - if ( status = FFI_Yajl.yajl_gen_integer(yajl_gen, self) ) != 0 - FFI_Yajl::Encoder.raise_error_for_status(status, str) - end - end - end -end - class Integer def ffi_yajl(yajl_gen, state) str = to_s -- cgit v1.2.1