From: Josh Cheek Date: 2012-04-23T16:08:16+09:00 Subject: Re: Why must I know whether I extend a class or a module? --f46d041825703e0ba804be534d9e Content-Type: text/plain; charset=ISO-8859-1 On Sun, Apr 22, 2012 at 3:01 AM, Intransition wrote: > In deed one could technically write all their code using modules. > > module Bar > def self.new > Class.new{ include Bar } > end > def initialize > end > end > > And yes, there is nothing stopping one from mixing in an #initialize > method. > You'd have to also extend class methods. --f46d041825703e0ba804be534d9e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sun, Apr 22, 2012 at 3:01 AM, Intransition <transfire@gmail.com> wrote:
In deed one could technically write all their code using = modules.

=A0 module Bar
=A0 =A0 def self= .new
=A0 =A0 =A0 Class.new{ include Bar }
=A0 =A0 end
=A0 =A0 def initialize
=A0 =A0 end
=A0 end

And yes, there = is nothing stopping one from mixing in an #initialize method.

You'd have = to also extend class methods.
=A0

--f46d041825703e0ba804be534d9e--