Sha256: 1888ad430aa1ea0cf560dfa48b1950919c0378de4d885698f1b3e9440f630680

Contents?: true

Size: 205 Bytes

Versions: 7

Compression:

Stored size: 205 Bytes

Contents

class Integer

  # Is is a multiple of a given number?
  #
  #   7.multiple?(2)  #=> false
  #   8.multiple?(2)  #=> true
  #
  #  CREDIT: Trans

  def multiple?(number)
    self % number == 0
  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
facets-2.4.0 lib/facets/integer/multiple.rb
facets-2.4.1 lib/facets/integer/multiple.rb
facets-2.4.2 lib/core/facets/integer/multiple.rb
facets-2.4.3 lib/core/facets/integer/multiple.rb
facets-2.4.4 lib/core/facets/integer/multiple.rb
facets-2.4.5 lib/core/facets/integer/multiple.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/integer/multiple.rb