# Re: Need help understanding namespace rules-modules and clas

**URL:** <https://www.ruby-forum.com/t/re-need-help-understanding-namespace-rules-modules-and-clas/60720>\
**Category:** Ruby\
**Created:** [May 17, 2006, 12:28am UTC](https://www.ruby-forum.com/t/re-need-help-understanding-namespace-rules-modules-and-clas/60720 "2006-05-17T00:28:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DEBAUNS\_STEVE\_SAG-C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58956e/32.png) [@DEBAUNS\_STEVE\_SAG-C](https://www.ruby-forum.com/u/DEBAUNS_STEVE_SAG-C)\
**Post date:** [May 17, 2006, 12:28am UTC](https://www.ruby-forum.com/t/re-need-help-understanding-namespace-rules-modules-and-clas/60720/1 "2006-05-17T00:28:50Z")

</div>

Ooh, ooh, I can do this one!!11!11

‘some\_file.rb’  
module Foo  
class Baz  
def woot; ‘hello I am in Foo’; end  
end  
end

‘some\_other\_file.rb’  
module Bar  
class Baz  
def woot; ‘hello I am in Bar’; end  
end  
class Pork  
def woot  
b = Baz.new # refers to Bar::Baz  
b2 = Foo::Baz.new # refers to the other Baz  
end  
end  
end

‘my\_file.rb’  
require ‘some\_file’  
require ‘some\_other\_file’  
fb = Foo::Baz.new  
bb = Bar::Baz.new
