--Apple-Mail10B1FEB-4587-49E3-A99D-2D273438EC28
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charseto-8859-1

On Jul 29, 2011, at 5:27 AM, Iki Baz Castillo wrote:

> But I didn't expect it to occur using a module as
> I'm not inheriting from a class.

Including a module inserts that module into the inheritance hierarchy.

class A
end
class B < A
end
module M
end

p B.ancestors
#=> [B, A, Object, Kernel, BasicObject]
class B
  include M
end

p B.ancestors
#=> [B, M, A, Object, Kernel, BasicObject]

More details than you'd probably like about this mechanism can be
found in a blog post of mine:

http://carboni.ca/blog/p/Modules-How-Do-They-Work

Michael Edgar
adgar / carboni.ca
http://carboni.ca/


--Apple-Mail10B1FEB-4587-49E3-A99D-2D273438EC28--