From: Chris Kottom Date: 2011-02-22T17:16:20+09:00 Subject: Re: How do I get the class(object) from another ruby script? --001e680f168843efc6049cda9839 Content-Type: text/plain; charset=UTF-8 Maybe I'm misunderstanding what you're trying to do. The Ruby interpreter won't have any variable called name in this program simply because you've required a file called name.rb. Assuming that your name.rb file has a class in it called Name, you would be able to require the file, create a new instance of Name and assign it to a variable called name, and then use it as you're trying to. # name.rb class Name attr_accessor :first, :last def to_s @first + " " + @last end end # main program require "./name" name = Name.new("Some", "Guy") puts "Hello, " + name On Tue, Feb 22, 2011 at 1:01 AM, Anthony Ob wrote: > Snippet of code: > > > require "./name.rb"; > require "./feelings.rb"; > puts "Hello, " + name > > > > > How do I get the class(object) from name.rb? > > -- > Posted via http://www.ruby-forum.com/. > > --001e680f168843efc6049cda9839--