From 37023788cf93d6e156d7a1e88ac4458645896e50 Mon Sep 17 00:00:00 2001 From: masatoshi_moritsuka Date: Sat, 4 Feb 2023 16:05:22 +0900 Subject: [PATCH] =?UTF-8?q?deconstruct=20=E3=81=A8=20deconstruct=5Fkeys=20?= =?UTF-8?q?=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E3=81=AE=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=81=AE=E8=A8=B3=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: shuichi cf. https://github.com/rurema/doctree/pull/2773#discussion_r1063635255 --- refm/doc/spec/pattern_matching.rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refm/doc/spec/pattern_matching.rd b/refm/doc/spec/pattern_matching.rd index 8c0397c657..aff10aa470 100644 --- a/refm/doc/spec/pattern_matching.rd +++ b/refm/doc/spec/pattern_matching.rd @@ -481,7 +481,7 @@ end ===[a:matching_non_primitive_objects] 非プリミティブなオブジェクトのマッチ: deconstruct メソッドと deconstruct_keys メソッド #@# As already mentioned above, array, find, and hash patterns besides literal arrays and hashes will try to match any object implementing +deconstruct+ (for array/find patterns) or +deconstruct_keys+ (for hash patterns). -既に先述されている通り、配列リテラルやハッシュリテラルの他に Array, Find, Hash パターンは deconstruct メソッド(これは Array/Find パターンで利用されます) か deconstruct_keys メソッド(これは Hash パターンで利用されます) が実装されたオブジェクトにマッチします。 +既に述べたように、Array/Find/Hash パターンは、配列やハッシュのリテラルの他に、deconstruct メソッド(Array/Find パターン) あるいは deconstruct_keys メソッド(Hash パターン) を定義しているオブジェクトに対しても、マッチを試みます。 #@samplecode class Point