From: kwatch@... (kwatch) Date: 2003-02-17T19:04:40+09:00 Subject: even? and odd? methods in Integer class Why Integer class doesn't have 'even?' nor 'odd?' method? Of course, it is easy to define by myself. But I wonder why these methods are not included in Ruby by default? ..-------------------- class Integer def even? return self % 2 == 0 end def odd? return self % 1 == 0 end end ..-------------------- I believe that these methods are very useful and friendly, especially for Web Designers. They're familiar with a concept about modulo, but not familiar with an operator of modulo (= '%'). ..-------------------- <% count = 0 %> <% for item in list do %> <% count += 1 %> <% if count % 2 == 0 then %>