[Rails] Re: Change 'nil' using literal notation?

2013-03-20 Thread Todd Hartsfield
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

[Rails] Re: Change 'nil' using literal notation?

2013-03-20 Thread Robert Walker
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,

[Rails] Re: Change 'nil' using literal notation?

2013-03-20 Thread Todd Hartsfield
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

Re: [Rails] Re: Change 'nil' using literal notation?

2013-03-20 Thread Dheeraj Kumar
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

Re: [Rails] Re: Change 'nil' using literal notation?

2013-03-20 Thread Jordon Bedwell
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

Re: [Rails] Re: Change 'nil' using literal notation?

2013-03-20 Thread Dheeraj Kumar
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.

[Rails] Re: Change 'nil' using literal notation?

2013-03-20 Thread Todd Hartsfield
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

Re: [Rails] Re: Change 'nil' using literal notation?

2013-03-20 Thread tamouse mailing lists
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