Archive for November 2009

L33t Links #49

It’s been real quiet in the Rails community the last couple of days, but now I have a few links ready for you:

L33t Links #48

L33t Links #47

L33t Links #46

L33t Links #45

L33t Links #44

L33t Links #43

L33t Links #42

#42! This blog post is the answer to everything! Or not!

Nested Classes

You may already know this, but this is absolutely new to me. Yesterday a question suddenly popped up: “Can you put a class into a class?” I instantly hopped into irb (<3) and did this:

david@david-laptop:~$ irb
irb(main):001:0> class Foo
irb(main):002:1>   class Bar
irb(main):003:2>   end
irb(main):004:1> end
=> nil
irb(main):005:0> Foo.new
=> #<Foo:0xb77130b0>
irb(main):006:0> Foo::Bar.new
=> #<Foo::Bar:0xb770f960>

I’ve been wondering if this was possible before, but kind of assumed it wasn’t. But it is, and it’s just another example of Ruby’s awesometasticness. I’ll definitely use this, and I hope it’ll be useful for you too.

L33t Links #41

So close to #42!