Sha256: d2a3aee0c5e1a0b6219d35892a610c330481003fb484b800fa924a742a543dd2

Contents?: true

Size: 308 Bytes

Versions: 177

Compression:

Stored size: 308 Bytes

Contents

# frozen_string_literal: true

class Integer
  # Check whether the integer is evenly divisible by the argument.
  #
  #   0.multiple_of?(0)  # => true
  #   6.multiple_of?(5)  # => false
  #   10.multiple_of?(2) # => true
  def multiple_of?(number)
    number == 0 ? self == 0 : self % number == 0
  end
end

Version data entries

177 entries across 169 versions & 22 rubygems

Version Path
omg-activesupport-8.0.0.alpha1 lib/active_support/core_ext/integer/multiple.rb
activesupport-7.1.4 lib/active_support/core_ext/integer/multiple.rb
activesupport-7.2.1 lib/active_support/core_ext/integer/multiple.rb
activesupport-7.2.0 lib/active_support/core_ext/integer/multiple.rb
activesupport-7.2.0.rc1 lib/active_support/core_ext/integer/multiple.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.4/lib/active_support/core_ext/integer/multiple.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/core_ext/integer/multiple.rb
activesupport-7.2.0.beta3 lib/active_support/core_ext/integer/multiple.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/core_ext/integer/multiple.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/core_ext/integer/multiple.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/core_ext/integer/multiple.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/core_ext/integer/multiple.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/core_ext/integer/multiple.rb
activesupport-7.2.0.beta2 lib/active_support/core_ext/integer/multiple.rb
activesupport-7.1.3.4 lib/active_support/core_ext/integer/multiple.rb
activesupport-7.0.8.4 lib/active_support/core_ext/integer/multiple.rb
activesupport-6.1.7.8 lib/active_support/core_ext/integer/multiple.rb
activesupport-7.2.0.beta1 lib/active_support/core_ext/integer/multiple.rb
activesupport-7.1.3.2 lib/active_support/core_ext/integer/multiple.rb
activesupport-7.1.3.1 lib/active_support/core_ext/integer/multiple.rb