aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/ostruct.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index 5f3d301ce0..c6f3be04e3 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -36,9 +36,10 @@
# Hash keys with spaces or characters that could normally not be used for
# method calls (e.g. <code>()[]*</code>) will not be immediately available
# on the OpenStruct object as a method for retrieval or assignment, but can
-# still be reached through the Object#send method.
+# still be reached through the Object#send method or using [].
#
# measurements = OpenStruct.new("length (in inches)" => 24)
+# measurements[:"length (in inches)"] # => 24
# measurements.send("length (in inches)") # => 24
#
# message = OpenStruct.new(:queued? => true)