diff options
Diffstat (limited to 'lib/hashie')
-rw-r--r-- | lib/hashie/extensions/coercion.rb | 9 | ||||
-rw-r--r-- | lib/hashie/mash.rb | 22 | ||||
-rw-r--r-- | lib/hashie/version.rb | 2 |
3 files changed, 11 insertions, 22 deletions
diff --git a/lib/hashie/extensions/coercion.rb b/lib/hashie/extensions/coercion.rb index a12490a..37d2d7c 100644 --- a/lib/hashie/extensions/coercion.rb +++ b/lib/hashie/extensions/coercion.rb @@ -17,14 +17,7 @@ module Hashie }.freeze ABSTRACT_CORE_TYPES = - if RubyVersion.new(RUBY_VERSION) >= RubyVersion.new('2.4.0') - { Numeric => [Integer, Float, Complex, Rational] } - else - { - Integer => [Fixnum, Bignum], - Numeric => [Fixnum, Bignum, Float, Complex, Rational] - } - end + { Numeric => [Integer, Float, Complex, Rational] } def self.included(base) base.send :include, InstanceMethods diff --git a/lib/hashie/mash.rb b/lib/hashie/mash.rb index d5cb308..21bcadb 100644 --- a/lib/hashie/mash.rb +++ b/lib/hashie/mash.rb @@ -322,22 +322,18 @@ module Hashie self.class.new(other_hash).merge(self) end - with_minimum_ruby('2.3.0') do - def dig(*keys) - super(*keys.map { |key| convert_key(key) }) - end + def dig(*keys) + super(*keys.map { |key| convert_key(key) }) end - with_minimum_ruby('2.4.0') do - def transform_values(&blk) - self.class.new(super(&blk)) - end + def transform_values(&blk) + self.class.new(super(&blk)) + end - # Returns a new instance of the class it was called on, with nil values - # removed. - def compact - self.class.new(super) - end + # Returns a new instance of the class it was called on, with nil values + # removed. + def compact + self.class.new(super) end with_minimum_ruby('2.5.0') do diff --git a/lib/hashie/version.rb b/lib/hashie/version.rb index 1c97af1..d19e3fe 100644 --- a/lib/hashie/version.rb +++ b/lib/hashie/version.rb @@ -1,3 +1,3 @@ module Hashie - VERSION = '5.0.1'.freeze + VERSION = '5.1.0'.freeze end |