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, just wondering. Thanks in advance
As an aside, you do realize that naming your variable "Hash_Name" makes it a constant right? Should be: hash_name = Hash.new("Anything other than nil!") If you really intended to make that new hash a constant then the convention is: HASH_NAME = Hash.new("Anything other than nil!") -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.