2011-12-26から1日間の記事一覧
「初めてのRuby(P151)」を読んでいたら以下のような記述があった。 class Foo @@class_variable = 'foo' def print p @@class_variable end end class Bar < Foo p @@class_variable #=> "foo" @@class_variable = 'bar' def print p @@class_variable end e…
「初めてのRuby(P151)」を読んでいたら以下のような記述があった。 class Foo @@class_variable = 'foo' def print p @@class_variable end end class Bar < Foo p @@class_variable #=> "foo" @@class_variable = 'bar' def print p @@class_variable end e…