From 7a533e0942ad810a577a50a6fd143e5e0a856dd2 Mon Sep 17 00:00:00 2001 From: masatoshi_moritsuka Date: Sat, 4 Feb 2023 15:58:20 +0900 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E3=81=A6=E3=81=AE=20deconstruct?= =?UTF-8?q?=E3=83=BBdeconstruct=5Fkeys=20=E3=81=AB=E3=80=8C=E3=83=A1?= =?UTF-8?q?=E3=82=BD=E3=83=83=E3=83=89=E3=80=8D=E3=82=92=E4=BB=98=E5=8A=A0?= 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#pullrequestreview-1239147496 --- refm/doc/spec/pattern_matching.rd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/refm/doc/spec/pattern_matching.rd b/refm/doc/spec/pattern_matching.rd index a97b1d2dfe..b0d5c26829 100644 --- a/refm/doc/spec/pattern_matching.rd +++ b/refm/doc/spec/pattern_matching.rd @@ -478,10 +478,10 @@ end #@end #@# == Matching non-primitive objects: +deconstruct+ and +deconstruct_keys+ -===[a:matching_non_primitive_objects] プリミティブなオブジェクト以外とのマッチ: deconstruct と deconstruct_keys +===[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 @@ -703,7 +703,7 @@ c #=> 未定義 #@end #@# Number of +deconstruct+, +deconstruct_keys+ method calls: -#@samplecode deconstruct や deconstruct_keys が呼び出された回数 +#@samplecode deconstruct メソッドや deconstruct_keys メソッドが呼び出された回数 $i = 0 ary = [0] def ary.deconstruct