From: Robert Klemme Date: 2013-04-19T19:00:58+09:00 Subject: Re: confusion with Struct class --047d7b675db09e7f2604dab3cb3f Content-Type: text/plain; charset=ISO-8859-1 On Thu, Apr 18, 2013 at 11:41 PM, Scott Shaffer wrote: > I like even more that you can include a module: > In other words: Struct generated classes are ordinary classes and the block passed to Struct.new is a class body as is the one passed to Class.new - no surprises here. :-) irb(main):001:0> c=Class.new do irb(main):002:1* def foo; 123 end irb(main):003:1> end => # irb(main):004:0> c.new.foo => 123 Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --047d7b675db09e7f2604dab3cb3f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On Thu, Apr 18, 2013 at 11:41 PM, Scott Shaffer &= lt;lists@ruby-for= um.com> wrote:
=A0
I like even more that you can include a modu= le:

In other words: Struct generated cla= sses are ordinary classes and the block passed to Struct.new is a class bod= y as is the one passed to Class.new - no surprises here. :-)

irb(main):001:0> c=3DClass.new do
ir= b(main):002:1* def foo; 123 end
irb(main):003:1> end
=3D> #<Class:0x8335bb4>
irb(main):004:0> c.new.foo
=3D> 123


=
Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end<= br>http://blog.rubybestpract= ices.com/
--047d7b675db09e7f2604dab3cb3f--