M
me
Hi there,
If I have a module and class like this:
module VisitMemory
def mark_visited(method)
@methods_visited << method.my_declaration_signature
end
def already_visited?(method)
@methods_visited.include?(method.my_declaration_signature)
end
end
module Guff
module JavaSource
class Class
include VisitMemory
end
end
end
How can i ensure that all instances of Guff::JavaSource::Class is
going to have the instance variable @methods_visited ?
So that this will work:
Guff::JavaSource::Class.new.already_visited?(something)
Thanks very much,
Mike.
If I have a module and class like this:
module VisitMemory
def mark_visited(method)
@methods_visited << method.my_declaration_signature
end
def already_visited?(method)
@methods_visited.include?(method.my_declaration_signature)
end
end
module Guff
module JavaSource
class Class
include VisitMemory
end
end
end
How can i ensure that all instances of Guff::JavaSource::Class is
going to have the instance variable @methods_visited ?
So that this will work:
Guff::JavaSource::Class.new.already_visited?(something)
Thanks very much,
Mike.