Yeah, so it's not actually a gotcha - it was just my misunderstanding
of what order methods would be called in. The case I stated as a
gotcha was when I tried calling super from the included module. I
guess the fact that you have to include the module *after* the method
is defined somehow threw me off. But it makes perfect sense, knowing
that including a module inserts it into the ancestry of the object,
that you have to call super in Foo's hello to get access to the
module's hello.

Thanks for clearing that up, Andrew.

On Dec 13, 11:08 pm, Andrew Grimm <[email protected]> wrote:
> What happens is that Foo#hello gets called, and then Baz#hello gets
> called, and then Baz#hello tries to call super, but there's nothing
> above Baz in the ancestors that can respond to hello. You can see this
> withhttps://gist.github.com/1471899
>
> Andrew
>
>
>
>
>
>
>
> On Tue, Dec 13, 2011 at 10:58 PM, Kunzmann <[email protected]> wrote:
> > Seems including an extra module in the middle works some magic?
>
> > This is what fails:
> >https://gist.github.com/1471853
>
> > On Dec 13, 9:59 pm, Andrew Grimm <[email protected]> wrote:
> >> What was the code demo'd at tonight's RORO tips and tricks about super in 
> >> Ruby?
>
> >> I tried doinghttps://gist.github.com/1471685andit worked as I expected it 
> >> to.
>
> >> Andrew
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Ruby or Rails Oceania" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/rails-oceania?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to