From: Fan Zhang Date: 2010-07-26T01:35:12+09:00 Subject: Re: syntax If you want to access private member variables of a class instance, using @ A quick search reveals this site: http://www.railsrocket.com/private-member-variables-in-ruby On Sun, Jul 25, 2010 at 8:41 PM, Raghu Maddali wrote: > I apologize for miscommunication.I know that Ruby will not have any > pointers and I guess its a variable declared with private access > modifier.Its like > > private $config; > $this->config = parse_ini_file('conf/Voyager.ini', true); > > So,how would you code this in Ruby?Is that the same > > private $config > $self.config=parse_ini_file(....)??? > > Raghu > >> presumably you want self.config = parse_ini_file(...) your actual >> question >> is a little unclear (I assume you meant to refer to a different >> language) >> but you should note that there are no pointers in Ruby, and in the >> preceeding example, "config=" is a method defined on self, you are not >> directly setting an instance variable like you would be in Java, but >> rather >> invoking a method which probably sets an instance variable, though not >> necessarily. > > -- > Posted via http://www.ruby-forum.com/. > >