Sha256: 7544525492546f0e7382d29b040deb65e537829a935b44d235315d79664b8378

Contents?: true

Size: 264 Bytes

Versions: 16

Compression:

Stored size: 264 Bytes

Contents

module MoreCoreExtensions
  module NumericMath
    #
    # Returns the square of a Numeric.
    #
    #   2.square     #=> 4
    #   10.0.square  #=> 100.0
    def square
      self * self
    end
  end
end

Numeric.send(:prepend, MoreCoreExtensions::NumericMath)

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
more_core_extensions-4.5.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-4.4.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-4.3.1 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-4.3.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-4.2.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-4.1.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-4.0.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-3.8.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-3.7.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-3.6.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-3.5.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-3.4.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-3.3.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-3.2.0 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-3.1.1 lib/more_core_extensions/core_ext/numeric/math.rb
more_core_extensions-3.1.0 lib/more_core_extensions/core_ext/numeric/math.rb