メモ

allocateとnew

rubyのallocateとnewの違い class Blog def initialize p 'initialize!' end end a = Blog.allocate p '*' * 10 b = Blog.new 結果 "**********" "initialize!!" まとめ allocateはインスタンスを生成する。 newはallocateを生成した後initializeを使い初期…

古いバージョンのアプリケーションを作成する方法

メモです。 rails _3.1.0_ new blog ※rails 3.1.0でblogというアプリケーションを作成する