C
curtis.schofield
Hi, I'm trying to use respond_to on a class for the purpose of getting
DRb to work with
method_missing. This is basically what i am doing. The situation is
that i'm not getting
the proper execution of methods if i use respond_to in this manner with
method_missing.
If i don't have a return true for @childrenArray in the respond_to then
things seem to work,
otherwise it seems to call the method_missing but the return value from
the @childArray send
doesn't seem to make it.. to_ary is being called , i'm trying to call
Foo.flatten.uniq
Any Suggestions?
class Foo
alias_method ld_respond_to? :respond_to?
def respond_to?(msg_id)
return true if @childrenArray.respond_to?(msg_id)
return true if self.old_respond_to?(msg_id)
false
end
def method_missing(*args)
if @childrenArray.respond_to(args[0])
return @childrenArray.send(*args)
else
raise NameError, "#{args.join(',')}"
end
end
end
DRb to work with
method_missing. This is basically what i am doing. The situation is
that i'm not getting
the proper execution of methods if i use respond_to in this manner with
method_missing.
If i don't have a return true for @childrenArray in the respond_to then
things seem to work,
otherwise it seems to call the method_missing but the return value from
the @childArray send
doesn't seem to make it.. to_ary is being called , i'm trying to call
Foo.flatten.uniq
Any Suggestions?
class Foo
alias_method ld_respond_to? :respond_to?
def respond_to?(msg_id)
return true if @childrenArray.respond_to?(msg_id)
return true if self.old_respond_to?(msg_id)
false
end
def method_missing(*args)
if @childrenArray.respond_to(args[0])
return @childrenArray.send(*args)
else
raise NameError, "#{args.join(',')}"
end
end
end