From 945a48c345e3ad65f14570594cc6843441cf1683 Mon Sep 17 00:00:00 2001 From: uNouss Date: Thu, 23 May 2024 15:07:27 +0200 Subject: [PATCH] Add missing enumerating methods for moosegroup - `#detect:ifOne:` - `#detect:ifFound:ifNone:` --- src/Moose-Core/MooseAbstractGroup.class.st | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Moose-Core/MooseAbstractGroup.class.st b/src/Moose-Core/MooseAbstractGroup.class.st index 22d8d55d..6b808474 100644 --- a/src/Moose-Core/MooseAbstractGroup.class.st +++ b/src/Moose-Core/MooseAbstractGroup.class.st @@ -301,12 +301,29 @@ MooseAbstractGroup >> detect: aBlock ifFound: anotherBlock [ ^ self entities detect: aBlock ifFound: anotherBlock ] +{ #category : #enumerating } +MooseAbstractGroup >> detect: aBlock ifFound: foundBlock ifNone: noneBlock [ + + ^ self entities + detect: aBlock + ifFound: foundBlock + ifNone: noneBlock +] + { #category : #enumerating } MooseAbstractGroup >> detect: aBlock ifNone: anotherBlock [ ^ self entities detect: aBlock ifNone: anotherBlock ] +{ #category : #enumerating } +MooseAbstractGroup >> detect: aBlock ifOne: anotherBlock [ + + ^ self entities + detect: aBlock + ifOne: anotherBlock +] + { #category : #enumerating } MooseAbstractGroup >> detectMax: aString [