2007-10-23から1日間の記事一覧
メソッドを追加するメソッド シンプルに考えれば、以下のようにメソッド定義の中にメソッド定義を書いても良いと気付いた。(define_methodは必要ない?) class Test def self.make_foo def foo 'foo' end end end test = Test.new Test.make_foo test.foo …
メソッドを追加するメソッド シンプルに考えれば、以下のようにメソッド定義の中にメソッド定義を書いても良いと気付いた。(define_methodは必要ない?) class Test def self.make_foo def foo 'foo' end end end test = Test.new Test.make_foo test.foo …