Use Ruby hash value inside of hash -


Is there any way to do something like this:

  number = {"one" = & Gt; "Two", "three" = & gt; Number ["a"]}   

I know that I can just make a hash and can generally set anything like "numbers" ["a"] I'm ... but ugly ...

No, because number right now Not defined, but you can create items assigned more than one variable:

  # looks strange, but ok ... def_num = "two" numbers = {'one '= & Gt; Def_num, 'two' = & gt; Def_num}    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -