Class: Bignum

Inherits:
Object
  • Object
show all
Defined in:
lib/distance/core_ext/integer.rb

Overview

In ruby versions before 2.4, multiplication was defined in Bignum and Fixnum, not in Integer

Instance Method Summary collapse

Instance Method Details

#*(other) ⇒ Object



24
25
26
# File 'lib/distance/core_ext/integer.rb', line 24

def *(other)
  other.is_a?(Distance) ? other * self : orig_multiply(other)
end

#orig_multiplyObject



22
# File 'lib/distance/core_ext/integer.rb', line 22

alias_method :orig_multiply, :*