Sha256: 5dc099a49b728468907955957a6a7a25069940fdf47fe6cfcf24dea731c30484

Contents?: true

Size: 270 Bytes

Versions: 143

Compression:

Stored size: 270 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

143 entries across 115 versions & 24 rubygems

Version Path
motion-support-1.2.1 motion/core_ext/integer/multiple.rb
motion-support-1.1.1 motion/core_ext/integer/multiple.rb
motion-support-1.2.0 motion/core_ext/integer/multiple.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/integer/multiple.rb
activesupport-3.2.22.5 lib/active_support/core_ext/integer/multiple.rb
activesupport-3.2.22.4 lib/active_support/core_ext/integer/multiple.rb
activesupport-3.2.22.3 lib/active_support/core_ext/integer/multiple.rb
motion-support-1.1.0 motion/core_ext/integer/multiple.rb
motion-support-1.0.0 motion/core_ext/integer/multiple.rb
activesupport-3.2.22.2 lib/active_support/core_ext/integer/multiple.rb
activesupport-3.2.22.1 lib/active_support/core_ext/integer/multiple.rb
motion-support-0.3.0 motion/core_ext/integer/multiple.rb
motion_blender-support-0.2.8 motion/core_ext/integer/multiple.rb
motion_blender-support-0.2.7 motion/core_ext/integer/multiple.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/integer/multiple.rb
activesupport-3.2.22 lib/active_support/core_ext/integer/multiple.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.12/lib/active_support/core_ext/integer/multiple.rb
activesupport-3.2.21 lib/active_support/core_ext/integer/multiple.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.18/lib/active_support/core_ext/integer/multiple.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/activesupport-3.2.18/lib/active_support/core_ext/integer/multiple.rb