Skip to content

Commit

Permalink
Integer Unification for Ruby 2.4.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
koic authored and smortex committed Aug 29, 2017
1 parent 7f68225 commit fd5b2e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ipaddress/prefix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ def <=>(oth)

#
# Sums two prefixes or a prefix to a
# number, returns a Fixnum
# number, returns a Integer
#
def +(oth)
if oth.is_a? Fixnum
if oth.is_a? Integer
self.prefix + oth
else
self.prefix + oth.prefix
Expand All @@ -68,10 +68,10 @@ def +(oth)
#
# Returns the difference between two
# prefixes, or a prefix and a number,
# as a Fixnum
# as a Integer
#
def -(oth)
if oth.is_a? Fixnum
if oth.is_a? Integer
self.prefix - oth
else
(self.prefix - oth.prefix).abs
Expand Down

0 comments on commit fd5b2e0

Please sign in to comment.