Sha256: 72f8bb4ae9b7d748b1883bca2165340492ef5e0ba1c24f139bbcaebee9d3b6ad

Contents?: true

Size: 204 Bytes

Versions: 7

Compression:

Stored size: 204 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 & 1 rubygems

Version Path
facets-2.8.1 lib/core/facets/integer/multiple.rb
facets-2.8.0 lib/core/facets/integer/multiple.rb
facets-2.7.0 lib/core/facets/integer/multiple.rb
facets-2.6.0 lib/core/facets/integer/multiple.rb
facets-2.5.0 lib/core/facets/integer/multiple.rb
facets-2.5.1 lib/core/facets/integer/multiple.rb
facets-2.5.2 lib/core/facets/integer/multiple.rb