[前][次][番号順一覧][スレッド一覧]

ruby-changes:62949

From: Marc-Andre <ko1@a...>
Date: Tue, 15 Sep 2020 01:47:32 +0900 (JST)
Subject: [ruby-changes:62949] 12a13eef49 (master): [ruby/ostruct] Tweak doc

https://git.ruby-lang.org/ruby.git/commit/?id=12a13eef49

From 12a13eef49dd2d839f502a7d848b7d600e8b645a Mon Sep 17 00:00:00 2001
From: Marc-Andre Lafortune <github@m...>
Date: Tue, 8 Sep 2020 17:13:03 -0400
Subject: [ruby/ostruct] Tweak doc


diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index 5f3d301..c6f3be0 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -36,9 +36,10 @@ https://github.com/ruby/ruby/blob/trunk/lib/ostruct.rb#L36
 # 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)
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]