- Ruby 初心者スレッド Part 57©2ch.net [転載禁止]©2ch.net
581 :uy ◆e6.oHu1j.o []:2015/10/31(土) 16:03:04.68 ID:eogiaEdE - >>580
その発想なかったです、 self.extendedを捨てればよかったのですね これで出来ましたありがとうございます module UY def self.my_exec arg define_method(:func){ p "hallo "+arg } self end end o = Object.new o.extend UY.my_exec("uy") o.func
|
|