ahh the Conditional Assignment Operator, thanks :)
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
Todd Hartsfield wrote in post #1102378:
Does anybody know can you change the output 'nil' to a different string
using literal notation? Besides constructor?
Hash_Name = Hash.new(Anything other than nil!)
Hash_name = {
key = value
}(Anything other than nil!)
New at this,
umm as long as a variable does not have special characters or a space in
it, as far as I am aware I thought variables are case sensitive, but
should work. The example above I see a variable needs to be ALL_CAPS or
all_lowercase, you cannot HaVe_bOtH. Is that correct?
--
Posted via
In ruby, any variable whose name starts with a capital letter becomes a
constant.
--
Dheeraj Kumar
On Thursday 21 March 2013 at 5:48 AM, Todd Hartsfield wrote:
umm as long as a variable does not have special characters or a space in
it, as far as I am aware I thought variables are case
On Wed, Mar 20, 2013 at 7:53 PM, Dheeraj Kumar
a.dheeraj.ku...@gmail.com wrote:
In ruby, any variable whose name starts with a capital letter becomes a
constant.
Which implies there are actually constants in Ruby.
--
You received this message because you are subscribed to the Google Groups
Jordan Bedwell is correct. Ruby's constants are /meant/ to be not changed, but
you can define a constant and change its value later. Ruby will produce a
warning 'already initialized constant'
Also note that your constant's internal representation can be changed without
triggering the warning.
I didn't know that, thank you!
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
On Wed, Mar 20, 2013 at 8:11 PM, Dheeraj Kumar
a.dheeraj.ku...@gmail.com wrote:
Jordan Bedwell is correct. Ruby's constants are /meant/ to be not changed,
but you can define a constant and change its value later. Ruby will produce
a warning 'already initialized constant'
Also note that your
8 matches
Mail list logo