If you have a class 'Thing'
does name of instance variable have to be:
@thing = Thing.new
or is
@widget = Thing.new
O.k. to use?
jet
If you have a class 'Thing'
does name of instance variable have to be:
@thing = Thing.new
or is
@widget = Thing.new
O.k. to use?
jet
Variables can be named whatever you'd like. Feel free to use
@widget = Thing.new
If you feel that 'widget' is a good name.
On Tue, Jan 12, 2010 at 7:50 PM, BlueHandTalking <jet@whidbey.com> wrote:
If you have a class 'Thing'
does name of instance variable have to be:
@thing = Thing.new
or is
@widget = Thing.new
O.k. to use?
jet
local_aaa = Thing.new
CONSTANT_BBB = Thing.new
$global_ccc = Thing.new
_a_n_y_ = Thing.new
@attribute_1 = Thing.new
@@class_var2 = Thing.new
*any* is valid, so any kind of attribute name is also valid.
Again I think you ask this because Rails conventions. If so remember please
that this is a Ruby maillist, and Rails rules/conventions are not a must here.
El Martes, 12 de Enero de 2010, BlueHandTalking escribió:
If you have a class 'Thing'
does name of instance variable have to be:
@thing = Thing.new
or is
@widget = Thing.new
O.k. to use?
--
Iñaki Baz Castillo <ibc@aliax.net>
How far do you think you'd get if you could only use "@fixnum" for numeric
values used as instance variables?
For that matter, what name would you give to an instance variable that
might, like any other variable in the language, hold different types of
objects in different contexts?
In short, the name is purely up to you.
-s
On 2010-01-12, BlueHandTalking <jet@whidbey.com> wrote:
If you have a class 'Thing'
does name of instance variable have to be:
@thing = Thing.new
or is
@widget = Thing.new
O.k. to use?
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net
| Seebs.Net <-- lawsuits, religion, and funny pictures
Fair game (Scientology) - Wikipedia <-- get educated!
Inaki,
Thanks for the example list.
Actually, I did not ask because it is a Rails thing.
I asked because I needed some fundamental, like very
basic knowledge about Ruby that I did not understand.
...and I did RTFM before this post.
Thanks again,
Jet
On Jan 12, 11:58 am, Iñaki Baz Castillo <i...@aliax.net> wrote:
El Martes, 12 de Enero de 2010, BlueHandTalking escribió:
> If you have a class 'Thing'
> does name of instance variable have to be:
> @thing = Thing.new
> or is
> @widget = Thing.new
> O.k. to use?
local_aaa = Thing.new
CONSTANT_BBB = Thing.new
$global_ccc = Thing.new
_a_n_y_ = Thing.new
@attribute_1 = Thing.new
@@class_var2 = Thing.new*any* is valid, so any kind of attribute name is also valid.
Again I think you ask this because Rails conventions. If so remember please
that this is a Ruby maillist, and Rails rules/conventions are not a must here.--
Iñaki Baz Castillo <i...@aliax.net>