2006-05-27から1日間の記事一覧
クラスの定義 クラスの定義はclass〜end class Hello def hello(str) puts "Hello, #{str}" end end if __FILE__ == $0 Hello.new.hello("Ruby") # Hello, Ruby endnewでオブジェクトを生成する.メソッドの呼び出しは.を用いる.__FILE__はそれが書かれてい…
クラスの定義 クラスの定義はclass〜end class Hello def hello(str) puts "Hello, #{str}" end end if __FILE__ == $0 Hello.new.hello("Ruby") # Hello, Ruby endnewでオブジェクトを生成する.メソッドの呼び出しは.を用いる.__FILE__はそれが書かれてい…