Class: Fixnum
Overview
extracted and adapted from ActiveSupport (rubyforge.org/projects/activesupport/)
Instance Method Summary collapse
Instance Method Details
#even? ⇒ Boolean
8 9 10 |
# File 'lib/strokedb/core_ext/fixnum.rb', line 8 def even? multiple_of? 2 end |
#multiple_of?(number) ⇒ Boolean
4 5 6 |
# File 'lib/strokedb/core_ext/fixnum.rb', line 4 def multiple_of?(number) self % number == 0 end |
#odd? ⇒ Boolean
12 13 14 |
# File 'lib/strokedb/core_ext/fixnum.rb', line 12 def odd? !even? end |