Created
May 23, 2012 16:45
-
-
Save shishi/2776296 to your computer and use it in GitHub Desktop.
nabeatsu for restrict condition sentenses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Nabeatsu | |
def say | |
content = { 'true' => 'hoge', 'false' => number.to_s } | |
true_or_false = (number % 3 == 0) || !!(number.to_s =~ /3/) | |
p content[true_or_false.to_s] | |
end | |
end | |
n = Nabeatsu.new | |
100.times do |x| | |
n.say x | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment