Rubyはクラスもオブジェクト
# coding: utf-8 class Foo def hello puts "hello" end end # クラスオブジェクトを変数に代入 a = Foo obj = a.new obj.hello
実行結果は
hello
です。
# coding: utf-8 class Foo def hello puts "hello" end end # クラスオブジェクトを変数に代入 a = Foo obj = a.new obj.hello
実行結果は
hello
です。