summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 1155a5756b..07ec93d784 100644
--- a/hash.c
+++ b/hash.c
@@ -6701,6 +6701,14 @@ static const rb_data_type_t env_data_type = {
* # Raises SyntaxError (syntax error, unexpected ':', expecting =>):
* h = {0: 'zero'}
*
+ * Hash value can be omitted, meaning that value will be fetched from the context
+ * by the name of the key:
+ *
+ * x = 0
+ * y = 100
+ * h = {x:, y:}
+ * h # => {:x=>0, :y=>100}
+ *
* === Common Uses
*
* You can use a \Hash to give names to objects: