# Include a class file for access to an object

**URL:** <https://www.ruby-forum.com/t/include-a-class-file-for-access-to-an-object/118762>\
**Category:** Rails\
**Created:** [October 30, 2007, 6:40pm UTC](https://www.ruby-forum.com/t/include-a-class-file-for-access-to-an-object/118762 "2007-10-30T18:40:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![newrubyuser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/898d66/32.png) [@newrubyuser](https://www.ruby-forum.com/u/newrubyuser)\
**Post date:** [October 30, 2007, 6:40pm UTC](https://www.ruby-forum.com/t/include-a-class-file-for-access-to-an-object/118762/1 "2007-10-30T18:40:54Z")

</div>

hello all

Im new to ruby and im just trying to see how i can instanciate an  
object that is defined in a class file like myclass.rb then in another  
file like start.rb i just call it like so newObj = myclass.new do i need  
the include statement at the top? like include myclass.rb or mayby the  
require statement? Thanks

---

<div class="post-metadata">

**Author:** ![newrubyuser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/898d66/32.png) [@newrubyuser](https://www.ruby-forum.com/u/newrubyuser)\
**Post date:** [October 31, 2007, 3:47pm UTC](https://www.ruby-forum.com/t/include-a-class-file-for-access-to-an-object/118762/2 "2007-10-31T15:47:12Z")

</div>

Brent B. wrote:

> hello all
> 
> Im new to ruby and im just trying to see how i can instanciate an  
> object that is defined in a class file like myclass.rb then in another  
> file like start.rb i just call it like so newObj = myclass.new do i need  
> the include statement at the top? like include myclass.rb or mayby the  
> require statement? Thanks

((this is a ruby related question, not a rails question, so rather than  
use [http://ruby-forum.com/forum/3](http://ruby-forum.com/forum/3) use [http://ruby-forum.com/forum/4](http://ruby-forum.com/forum/4)))
