On 9/1/06, Eric Hodel <drbrain / segment7.net> wrote:
> If you're going this way,
>
> class Foo::Bar::Baz
>
> leaves out lots of indentation.

That's really cool!

However, it only really works if you don't reference things in the Foo
or Bar modules.  E.g.:

class Foo::Bar::Baz
end

class Foo::Bar::Qux
  def fetch_me_a_baz
    Foo::Bar::Baz.new()      # <- need to use explicit namespace here
  end
end

Versus the nested case:

module Foo
  module Bar
    class Baz
    end

    class Qux
      def fetch_me_a_baz
        Baz.new()               # <- this line is simpler
      end
    end
  end
end

Well, that was a bit wordier than I expected it to be.  I guess it's a
tradeoff that you can make depending on how many times you need to use
Baz from inside Qux.  Nice!

-RYaN