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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Brent Brent 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 use http://ruby-forum.com/forum/4)) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Apparently Analagous Threads
- bug in methods' 'initialize' (or the functions called in turn) ?
- Replacing slot of S4 class in method of S4 class?
- SystemStackError: stack level too deep
- How to add a slot to S4 class of an existing package?
- Possible bug in `class<-` when a class-specific '[[.' method is defined