mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
literals.rdoc: quoted symbol keys
* doc/syntax/literals.rdoc (Hashes): describe about quoted symbol keys. [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
25dddf158c
commit
d1e65737f6
1 changed files with 8 additions and 0 deletions
|
@ -233,6 +233,14 @@ You can create a hash using symbol keys with the following syntax:
|
|||
|
||||
This same syntax is used for keyword arguments for a method.
|
||||
|
||||
Like Symbol literals, you can qoute symbol keys.
|
||||
|
||||
{ "a 1": 1, "b #{1 + 1}": 2 }
|
||||
|
||||
is equal to
|
||||
|
||||
{ :"a 1" => 1, :"b 2" => 2 }
|
||||
|
||||
See Hash for the methods you may use with a hash.
|
||||
|
||||
== Ranges
|
||||
|
|
Loading…
Reference in a new issue