[ruby/ostruct] Tweak doc

This commit is contained in:
Marc-Andre Lafortune 2020-09-08 17:13:03 -04:00
parent 8eefa8f373
commit 12a13eef49

View File

@ -36,9 +36,10 @@
# Hash keys with spaces or characters that could normally not be used for # Hash keys with spaces or characters that could normally not be used for
# method calls (e.g. <code>()[]*</code>) will not be immediately available # method calls (e.g. <code>()[]*</code>) will not be immediately available
# on the OpenStruct object as a method for retrieval or assignment, but can # 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 = OpenStruct.new("length (in inches)" => 24)
# measurements[:"length (in inches)"] # => 24
# measurements.send("length (in inches)") # => 24 # measurements.send("length (in inches)") # => 24
# #
# message = OpenStruct.new(:queued? => true) # message = OpenStruct.new(:queued? => true)