J
Jarod Zhu
For same reason, I want to invoke the 'include' in the class instance
function.
The code like this:
******************************************************************************************
class QQ
module QQ_Elem
def print_elem
puts "elem"
end
end
def test
include QQ_Elem
print_elem
puts "test"
end
end
qq = QQ.new
qq.test
******************************************************************************************
But I got the error like this:
in `test': undefined method `include' for #<QQ:0x2bb5150>
(NoMethodError)
Is there anyone know the solution$B!)(B
Thank you
function.
The code like this:
******************************************************************************************
class QQ
module QQ_Elem
def print_elem
puts "elem"
end
end
def test
include QQ_Elem
print_elem
puts "test"
end
end
qq = QQ.new
qq.test
******************************************************************************************
But I got the error like this:
in `test': undefined method `include' for #<QQ:0x2bb5150>
(NoMethodError)
Is there anyone know the solution$B!)(B
Thank you