author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 18 Sep 2012 13:10:10 +0000 | |
changeset 14 | f01fe37493e9 |
parent 11 | d354ac2af7ec |
child 16 | 25ac697dc747 |
permissions | -rw-r--r-- |
11
d354ac2af7ec
Metacello package refactoring - phase 2~
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10
diff
changeset
|
1 |
"{ Package: 'stx:goodies/metacello/core' }" |
1 | 2 |
|
3 |
MetacelloMethodSection subclass:#MetacelloVersionMethodSection |
|
4 |
instanceVariableNames:'block versionSpec parent methodSections' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
7 |
category:'Metacello-Core-Constructors' |
|
8 |
! |
|
9 |
||
10 |
||
11 |
!MetacelloVersionMethodSection methodsFor:'accessing'! |
|
12 |
||
13 |
addMethodSection: methodSection |
|
14 |
||
15 |
methodSection parent: self. |
|
16 |
self methodSections add: methodSection |
|
17 |
! |
|
18 |
||
19 |
attributeOrPath |
|
14
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
20 |
^ self parent == nil |
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
21 |
ifTrue: [ |
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
22 |
self attributes size == 1 |
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
23 |
ifTrue: [ self attributes first ] |
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
24 |
ifFalse: [ self attributes ] ] |
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
25 |
ifFalse: [ self attributePath ] |
1 | 26 |
! |
27 |
||
28 |
attributePath |
|
14
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
29 |
| path | |
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
30 |
path := MetacelloMethodSectionPath with: self attributes. |
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
31 |
^ self parent == nil |
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
32 |
ifTrue: [ path ] |
f01fe37493e9
- MetacelloProjectSpecForLoad
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
33 |
ifFalse: [ self parent attributePath , path ] |
1 | 34 |
! |
35 |
||
36 |
block |
|
37 |
^ block |
|
38 |
! |
|
39 |
||
40 |
block: anObject |
|
41 |
block := anObject |
|
42 |
! |
|
43 |
||
44 |
methodSections |
|
45 |
||
46 |
methodSections ifNil: [ methodSections := OrderedCollection new ]. |
|
47 |
^methodSections |
|
48 |
! |
|
49 |
||
50 |
parent |
|
51 |
^ parent |
|
52 |
! |
|
53 |
||
54 |
parent: anObject |
|
55 |
parent := anObject |
|
56 |
! |
|
57 |
||
58 |
topParent |
|
59 |
self parent == nil |
|
60 |
ifTrue: [ ^ self ]. |
|
61 |
^ self parent topParent |
|
62 |
! |
|
63 |
||
64 |
versionSpec |
|
65 |
^ versionSpec |
|
66 |
! |
|
67 |
||
68 |
versionSpec: anObject |
|
69 |
versionSpec := anObject |
|
70 |
! ! |
|
71 |
||
72 |
!MetacelloVersionMethodSection class methodsFor:'documentation'! |
|
73 |
||
74 |
version_SVN |
|
75 |
^ '$Id:: $' |
|
76 |
! ! |