[ruby-talk:00332] Re: module-class calling

From: Shugo Maeda <shugo@...>
Date: 1999-05-22 09:39:39 UTC
List: ruby-talk #332
At Sat, 22 May 1999 11:14:50 +0200,
Michael Neumann <neumann@s-direktnet.de> wrote:
> Following example didn't work! Why?
(snip)
> class B
>  def call_A
> include A# error
> A.hello
>  end
> end

`include A' must be out of method, and `A.hello' must be rewritten
to `hello' or `self.hello' (because `hello' is an instance method).

class B
  include A
  def call_A
    hello
  end
end

Hope this helps,
Shugo

In This Thread