From: Love U Ruby Date: 2013-07-23T13:43:41+09:00 Subject: How can we create instance method and class methods at runtime in ruby? How can we create instance method and class methods at runtime in ruby? class Foo def test p "hi" end end foo = Foo.new foo.test # => "hi" class Foo def test p "hiyy" end end foo.test # >> "hi" # >> "hiyy" How Can I re-define the `test` method at runtime? I tried `define_method`,but it didn't work for this. -- Posted via http://www.ruby-forum.com/.