Skip to content

Instantly share code, notes, and snippets.

@27Cobalter
Created June 3, 2017 17:34
Show Gist options
  • Save 27Cobalter/971094344bc08ab7e5eb2f43b015225d to your computer and use it in GitHub Desktop.
Save 27Cobalter/971094344bc08ab7e5eb2f43b015225d to your computer and use it in GitHub Desktop.
class Hoge
def fuga(var)
if var%15 == 0 then
return 15
elsif var%5 == 0 then
return 5
elsif var%3 == 0 then
return 3
else
return var
end
end
end
Fifteen = 15
Five = 5
Three = 3
myon = Hoge.new
for num in 1..100 do
case myon.fuga(num)
when Fifteen then
puts "FizzBuzz"
when Five then
puts "Buzz"
when Three then
puts "Fizz"
else
puts num
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment