Skip to content

Commit

Permalink
Implement all of notnotodd
Browse files Browse the repository at this point in the history
  • Loading branch information
Igneous committed Dec 21, 2023
1 parent 709337c commit 892de8b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/not_not_odd.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Integer
def method_missing(m, *args, &block)
/is_(not_)+odd\?/.match?(m) ? ( m.to_s.scan(/not_/).count.odd? ? even? : odd? ) : super
end
end
13 changes: 13 additions & 0 deletions not_not_odd.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Gem::Specification.new do |s|
s.name = "not_not_odd"
s.version = "0.0.1"
s.summary = "It's Not _not_ Odd!"
s.description = "Checks if a number isn't not odd."
s.authors = ["Jon O'Donnell"]
s.email = "johnodonnell1997@icloud.com"
s.files = ["lib/not_not_odd.rb"]
s.homepage =
"https://rubygems.org/gems/not_not_odd"
s.license = "MIT"
end

0 comments on commit 892de8b

Please sign in to comment.