08/05/04 23:24:56
>>200
今までは否定派だったが、これを知って考えが変わった。
こういうことが余計な苦労無くできるなんて、ほんとうに素晴らしい言語だと思う。
class Test
def show_yourself()
puts "ノンケ"
end
def func(value)
if value % 2 == 0
def show_yourself()
puts "ウホッ"
end
else
def show_yourself()
puts "オネエさま~"
end
end
end
end
obj = Test.new
obj.show_yourself()
5.times do
obj.func(rand(100))
obj.show_yourself()
end