Newsgroups: comp.lang.ruby
From: Extreme Noob <bengaly...@hotmail.com>
Date: Sun, 11 May 2008 15:22:21 -0500
Local: Sun, May 11 2008 4:22 pm
Subject: Container wont contain! (noob question)
Here I want to change Class1's var2 to equal 2. Now, I can do this by..
"object.m_container.container1 = Class1.new(2)", but I want to do it with "object.change_me = 2" Point is I want to change that variable by simply using a number, as apposed to xxx.new(arg). Why wont object.change_me =2 work? (sorry if this seems confusing or silly) The following is a highly simplified representation of my current #****************************************************************** class Class1 def initialize(aVar) class Class2 def initialize(container1) class M_class def initialize def change_me object = M_class.new #object.m_container.container1 = Class1.new(2) <--- currently doing it #object.change_me = 2 <----- want to do it like this (or something as p object #******************************************************* You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||