Yes, the first assignment to it. Since Ruby does not define variables by type (such as 'String my_var') but determines the type from whats assigned to it (eg, if you assign:  my_var = "This block of text"   it knows it”Ēs a string), there is no declaration like what you're used to.


-----Original Message-----
From: sto.mar / web.de [mailto:sto.mar / web.de] 
Sent: Friday, April 26, 2013 11:00 AM
To: ruby-talk ML
Subject: Re: BEGINNER -CLASS QUERY

Am 24.04.2013 17:14, schrieb D. Deryl Downey:
>
>> Sorry for the confusion. From my (obviously limited) knowledge of 
>> languages I thought that was a general rule. Let's change that then 
>> to "in Ruby, you don't declare variables...".
>
> Change that to you don't *have to* declare variables. "You don't declare" would be misleading.
>

How would you declare a variable in Ruby? Do you mean the first assignment to it? To me, "declaring" signifies a type declaration like in C or Java.


--
<https://github.com/stomar/>