1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/ostruct] Restore ostruct doc

This commit is contained in:
Marc-Andre Lafortune 2020-11-04 16:09:51 -05:00 committed by Marc-André Lafortune
parent 6f24be8565
commit 015b023820
Notes: git 2020-11-05 07:52:32 +09:00

View file

@ -36,15 +36,15 @@
# 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 or using [].
# 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
# measurements.send("length (in inches)") # => 24
#
# message = OpenStruct.new(:queued? => true)
# message.queued? # => true
# message.__send__("queued?=", false)
# message.send("queued?=", false)
# message.queued? # => false
#
# Removing the presence of an attribute requires the execution of the