Skip to content

Instantly share code, notes, and snippets.

@shishi
Created May 23, 2012 16:45
Show Gist options
  • Save shishi/2776296 to your computer and use it in GitHub Desktop.
Save shishi/2776296 to your computer and use it in GitHub Desktop.
nabeatsu for restrict condition sentenses
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