# Easy question: access module/class outside of current scope

**URL:** <https://www.ruby-forum.com/t/easy-question-access-module-class-outside-of-current-scope/113980>\
**Category:** Ruby\
**Created:** [September 6, 2007, 9:06pm UTC](https://www.ruby-forum.com/t/easy-question-access-module-class-outside-of-current-scope/113980 "2007-09-06T21:06:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwv549](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ac8455/32.png) [@bwv549](https://www.ruby-forum.com/u/bwv549)\
**Post date:** [September 6, 2007, 9:06pm UTC](https://www.ruby-forum.com/t/easy-question-access-module-class-outside-of-current-scope/113980/1 "2007-09-06T21:06:03Z")

</div>

I’ve seen someone do this, but I forget how it is done and I can’t  
find it by searching…

module Dog  
def self.new  
puts ‘ruff ruff’  
end  
end

class Crazy  
class Dog  
def some\_method  
mydog = Dog.new # I want the module Dog and not the class Dog  
that I’m in…  
end  
end  
end

# What is the nomenclature to get at the module Dog above and not the

Dog class I’m inside?

Thanks

---

<div class="post-metadata">

**Author:** ![bwv549](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ac8455/32.png) [@bwv549](https://www.ruby-forum.com/u/bwv549)\
**Post date:** [September 6, 2007, 9:54pm UTC](https://www.ruby-forum.com/t/easy-question-access-module-class-outside-of-current-scope/113980/2 "2007-09-06T21:54:10Z")

</div>

[bwv549 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid), 2007-09-06 21.05 CEST]

> class Dog  
> def some\_method  
> mydog = Dog.new # I want the module Dog and not the class Dog  
> that I’m in…  
> end  
> end  
> end
> 
> # What is the nomenclature to get at the module Dog above and not the
> 
> Dog class I’m inside?

::Dog

> Thanks

You’re welcome ;).
