Sha256: 3efbcf494953d6024bf0f11c4b9ad41dba43811633d5611212d0dce8a2f69af3

Contents?: true

Size: 273 Bytes

Versions: 201

Compression:

Stored size: 273 Bytes

Contents

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 % number == 0 : zero?
  end
end

Version data entries

201 entries across 192 versions & 19 rubygems

Version Path
activesupport-5.0.4.rc1 lib/active_support/core_ext/integer/multiple.rb
activesupport-4.2.9.rc1 lib/active_support/core_ext/integer/multiple.rb
activesupport-5.1.1 lib/active_support/core_ext/integer/multiple.rb
activesupport-5.0.3 lib/active_support/core_ext/integer/multiple.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activesupport-4.2.8/lib/active_support/core_ext/integer/multiple.rb
activesupport-5.1.0 lib/active_support/core_ext/integer/multiple.rb
activesupport-5.1.0.rc2 lib/active_support/core_ext/integer/multiple.rb
lazy_record-0.2.1 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
lazy_record-0.2.0 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
lazy_record-0.1.9 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
lazy_record-0.1.8 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
lazy_record-0.1.7 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
lazy_record-0.1.6 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
lazy_record-0.1.4 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
tdiary-5.0.4 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
activesupport-5.1.0.rc1 lib/active_support/core_ext/integer/multiple.rb
lazy_record-0.1.3 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
lazy_record-0.1.2 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb
lazy_record-0.1.1 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/core_ext/integer/multiple.rb