Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Fix deprecation warnings about Fixnum for Ruby >= 2.4 #13

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/kashmir/representation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down