Skip to content

Commit dd893b2

Browse files
Added #forContext: instance creation method.
Fixes #20.
1 parent 15fdfb1 commit dd893b2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Commander2/CmAbstractCommand.class.st

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ Class {
99
#category : #'Commander2-Commands'
1010
}
1111

12+
{ #category : #'instance creation' }
13+
CmAbstractCommand class >> forContext: anObject [
14+
"Creates a new command with anObject as context."
15+
^ self new
16+
context: anObject;
17+
yourself
18+
]
19+
1220
{ #category : #visiting }
1321
CmAbstractCommand >> acceptVisitor: aCmCommandOrGroup [
1422
^ aCmCommandOrGroup visitCommand: self

0 commit comments

Comments
 (0)