F
Florian Aßmann
Hello,
I try to include some modules to a class instance, but I have
problems with the scope, here's what I did:
person.roles.each do |role|
class << person
include role.class.const_get('Functions')
end if role.class.const_defined?('Functions')
end unless person.nil?
As you can see role is not defined when I include it, does anybody
know how I can add some singleton methods to person?
Regards
Florian
I try to include some modules to a class instance, but I have
problems with the scope, here's what I did:
person.roles.each do |role|
class << person
include role.class.const_get('Functions')
end if role.class.const_defined?('Functions')
end unless person.nil?
As you can see role is not defined when I include it, does anybody
know how I can add some singleton methods to person?
Regards
Florian