Skip to content

Commit

Permalink
Merge pull request #647 from kachick/implement-integer-even,odd
Browse files Browse the repository at this point in the history
Implement Integer#even?, Integer#odd?
  • Loading branch information
alex committed Apr 20, 2013
2 parents dece7d4 + 691aaf5 commit 58e722c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
8 changes: 8 additions & 0 deletions lib-topaz/integer.rb
Expand Up @@ -26,4 +26,12 @@ def next
def pred
return self - 1
end

def even?
(self % 2).zero?
end

def odd?
!even?
end
end
1 change: 0 additions & 1 deletion spec/tags/core/integer/even_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/core/integer/odd_tags.txt

This file was deleted.

0 comments on commit 58e722c

Please sign in to comment.