2011-04-10から1日間の記事一覧
ちなみに 下記は、Ruby 1.9系では構文エラーになる。 知ってちょっとびっくりした # # test.rb # class RetryTest def initialize @x = 0 puts "initialize!!" end def test x @x += 1 yield @x retry if x > @x end end puts RUBY_VERSION t = RetryTest.ne…
ちなみに 下記は、Ruby 1.9系では構文エラーになる。 知ってちょっとびっくりした # # test.rb # class RetryTest def initialize @x = 0 puts "initialize!!" end def test x @x += 1 yield @x retry if x > @x end end puts RUBY_VERSION t = RetryTest.ne…