From: tamouse mailing lists Date: 2013-02-25T02:16:35+09:00 Subject: Re: Why class returning its own name when "include" statement? --e89a8f22bcc353db8304d67b9388 Content-Type: text/plain; charset=UTF-8 On Feb 24, 2013 11:05 AM, "Love U Ruby" wrote: > > tamouse mailing lists wrote in post #1098808: > > On Feb 23, 2013 2:21 AM, "Love U Ruby" wrote: > >> class Foo > >> > >> Does that mean @x has been already initialized? or curious to know what > >> "10648020" contains into it? > > > > @x is set inside the class and will be set thus when Foo.new or Too.new > > is > > called. Each such object will have its own copy of @x. > > > > The number in quotes is the inspected object id of the included Show > > module > > instance. > > not sure about your statement. seems @ Stefano statement contradicts > with you. > > Can it be more specific what you meant to say? > They are not inconsistent at all. In each,the result of the last expression evaluated is returned. In the last case, you evaluated (include Show).object_id.inspect, didn't you? > -- > Posted via http://www.ruby-forum.com/. > --e89a8f22bcc353db8304d67b9388 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Feb 24, 2013 11:05 AM, "Love U Ruby" <lists@ruby-forum.com> wrote:
>
> tamouse mailing lists wrote in post #1098808:
> > On Feb 23, 2013 2:21 AM, "Love U Ruby" <lists@ruby-forum.com> wrote:
> >> =C2=A0 class Foo
> >>
> >> Does that mean @x has been already initialized? or curious to= know what
> >> "10648020" contains into it?
> >
> > @x is set inside the class and will be set thus when Foo.new or T= oo.new
> > is
> > called. Each such object will have its own copy of @x.
> >
> > The number in quotes is the inspected object id of the included S= how
> > module
> > instance.
>
> not sure about your statement. seems @ Stefano statement contradicts > with you.
>
> Can it be more specific what you meant to say?
>

They are not inconsistent at all. In each,the result of the last express= ion evaluated is returned.=C2=A0 In the last case, you evaluated (include S= how).object_id.inspect, didn't you?

> --
> Posted via http://www.ruby-foru= m.com/.
>

--e89a8f22bcc353db8304d67b9388--