From a90f15d6c44564dde644e26ae848374b68a09273 Mon Sep 17 00:00:00 2001 From: Max Bigras Date: Fri, 27 Apr 2018 11:20:06 -0700 Subject: [PATCH 1/2] Fix deprecation warnings about Fixnum for Ruby >= 2.4 More details at: https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/#unify-fixnum-and-bignum-into-integer --- lib/kashmir/representation.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/kashmir/representation.rb b/lib/kashmir/representation.rb index fa97603..d12833f 100644 --- a/lib/kashmir/representation.rb +++ b/lib/kashmir/representation.rb @@ -111,7 +111,13 @@ def read_value(instance, field) end def primitive?(field_value) - [Fixnum, String, Date, Time, TrueClass, FalseClass, Symbol].any? do |type| + primitives = [String, Date, Time, TrueClass, FalseClass, Symbol] + primitives << if RUBY_VERSION > '2.4' + Integer + else + Fixnum + end + primitives.any? do |type| field_value.is_a?(type) end end From 307daa38ae7bf6e50f22a5910eadc99cb4176fd6 Mon Sep 17 00:00:00 2001 From: Max Bigras Date: Fri, 27 Apr 2018 12:57:00 -0700 Subject: [PATCH 2/2] Fix typo, > needs to be >= --- lib/kashmir/representation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kashmir/representation.rb b/lib/kashmir/representation.rb index d12833f..6d9a562 100644 --- a/lib/kashmir/representation.rb +++ b/lib/kashmir/representation.rb @@ -112,7 +112,7 @@ def read_value(instance, field) def primitive?(field_value) primitives = [String, Date, Time, TrueClass, FalseClass, Symbol] - primitives << if RUBY_VERSION > '2.4' + primitives << if RUBY_VERSION >= '2.4' Integer else Fixnum