1.8.x public send?

Oh crud,

  class A
    def initialize
      @b = B.new
    end
    def method_missing(s, *a, &b)
      @b.__send__(s,*a,&b)
    end
  end

  class B
    def method_missing(s,*a,&b)
      "HERE"
    end
  end

  A.new.foo

How to get "HERE"?

Works for me.

I just had to `puts A.new.foo`

···

On Mon, Sep 22, 2008 at 1:40 PM, Trans <transfire@gmail.com> wrote:

Oh crud,

class A
   def initialize
     @b = B.new
   end
   def method_missing(s, *a, &b)
     @b.__send__(s,*a,&b)
   end
end

class B
   def method_missing(s,*a,&b)
     "HERE"
   end
end

A.new.foo

How to get "HERE"?

My bad, I mistook my trouble for this issue. But actually the trouble
only arises when:

  class B
    def method_missing(s,*a,&b)
      "HERE"
    end
  private
    def foo; 'foo'; end
  end

Because method_missing applies to public calls and ignores private
ones.

T.

···

On Sep 22, 3:03 pm, "Michael Guterl" <mgut...@gmail.com> wrote:

On Mon, Sep 22, 2008 at 1:40 PM, Trans <transf...@gmail.com> wrote:
> Oh crud,

> class A
> def initialize
> @b = B.new
> end
> def method_missing(s, *a, &b)
> @b.__send__(s,*a,&b)
> end
> end

> class B
> def method_missing(s,*a,&b)
> "HERE"
> end
> end

> A.new.foo

> How to get "HERE"?

Works for me.

I just had to `puts A.new.foo`