aboutsummaryrefslogtreecommitdiffstats
path: root/doc/syntax
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-29 05:29:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-29 05:29:28 +0000
commitd1e65737f65b984ca4d3970d0fe984745db80554 (patch)
treeeeb26dcecd7d806d1e40c469b329244d0a82ba14 /doc/syntax
parent25dddf158ca61d3a1de748d8d8035fe79a759d62 (diff)
downloadruby-d1e65737f65b984ca4d3970d0fe984745db80554.tar.gz
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
Diffstat (limited to 'doc/syntax')
-rw-r--r--doc/syntax/literals.rdoc8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/syntax/literals.rdoc b/doc/syntax/literals.rdoc
index 194945abbd..cc05497dec 100644
--- a/doc/syntax/literals.rdoc
+++ b/doc/syntax/literals.rdoc
@@ -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