Skip to content

Instantly share code, notes, and snippets.

@roman
Forked from hassox/gist:231290
Created November 10, 2009 21:47
Show Gist options
  • Select an option

  • Save roman/231304 to your computer and use it in GitHub Desktop.

Select an option

Save roman/231304 to your computer and use it in GitHub Desktop.

Revisions

  1. roman revised this gist Nov 10, 2009. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    module Foo
    def test
    Baz
    self.class::Baz
    end
    end
    => nil
    @@ -16,6 +16,4 @@ class Baz
    => #<Bar:0x101275978>

    b.test
    NameError: uninitialized constant Foo::Baz
    from (irb):3:in `test'
    from (irb):12
    => Bar::Baz
  2. hassox created this gist Nov 10, 2009.
    21 changes: 21 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    module Foo
    def test
    Baz
    end
    end
    => nil

    class Bar
    include Foo
    class Baz
    end
    end
    => nil

    b = Bar.new
    => #<Bar:0x101275978>

    b.test
    NameError: uninitialized constant Foo::Baz
    from (irb):3:in `test'
    from (irb):12