-
-
Notifications
You must be signed in to change notification settings - Fork 353
/
RBCustomTransformation.class.st
69 lines (56 loc) · 1.64 KB
/
RBCustomTransformation.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"
Performs a custom transformation. With this class, the developer can manipulate the model (a RBNamespace) directly, i.e., adding classes, transforming them etc.
Usage:
transformation := (RBCustomTransformation with: [ :model |
model defineClass: ('Object subclass: #Bla
instanceVariableNames: ''''
classVariableNames: ''''
poolDictionaries: ''''
category: ', 'Refactoring2-Transformations' surroundedBySingleQuotes ).
(model classNamed: #Bla)
comment: 'Deprecated!!! Use super class' ])
transform.
(ChangesBrowser changes: transformation model changes changes) open
"
Class {
#name : #RBCustomTransformation,
#superclass : #RBTransformation,
#instVars : [
'transformationBlock'
],
#category : #'Refactoring2-Transformations-Model'
}
{ #category : #api }
RBCustomTransformation class >> model: aRBModel with: aBlockWithOneArg [
^ self new
model: aRBModel;
transformationBlock: aBlockWithOneArg;
yourself
]
{ #category : #api }
RBCustomTransformation class >> with: aBlockWithOneArg [
^ self new
transformationBlock: aBlockWithOneArg;
yourself
]
{ #category : #preconditions }
RBCustomTransformation >> preconditions [
"no precondition so far"
^ RBCondition empty
]
{ #category : #executing }
RBCustomTransformation >> privateTransform [
transformationBlock value: self model
]
{ #category : #printing }
RBCustomTransformation >> storeOn: aStream [
aStream nextPut: $(.
self class storeOn: aStream.
aStream nextPutAll: ' with: '.
transformationBlock storeOn: aStream.
aStream nextPut: $)
]
{ #category : #api }
RBCustomTransformation >> transformationBlock: aBlockWithOneArg [
transformationBlock := aBlockWithOneArg
]