refactoring: consistency in initialization.
This commit is contained in:
parent
0b81fcdff2
commit
4810e16b17
|
@ -8,11 +8,23 @@ Class {
|
|||
#category : #Hitch
|
||||
}
|
||||
|
||||
{ #category : #'private - class factory' }
|
||||
HitchAttribute class >> getResponsibleAttributeClassFor: anAttribute [
|
||||
|
||||
^ self allSubclasses detect: [ :attrClass | attrClass handlesAttribute: anAttribute ]
|
||||
ifNone: [ self ]
|
||||
]
|
||||
|
||||
{ #category : #'private - class factory' }
|
||||
HitchAttribute class >> handlesAttribute: anAttribute [
|
||||
|
||||
^ SubclassResponsibility
|
||||
]
|
||||
|
||||
{ #category : #'instance creation' }
|
||||
HitchAttribute class >> name: attrName value: attrValue [
|
||||
^ self new
|
||||
name: attrName
|
||||
value: attrValue.
|
||||
HitchAttribute class >> name: attrName value: attrValue [
|
||||
|
||||
^ (self getResponsibleAttributeClassFor: attrName) new name: attrName value: attrValue
|
||||
]
|
||||
|
||||
{ #category : #rendering }
|
||||
|
|
|
@ -32,22 +32,18 @@ Class {
|
|||
#category : #Hitch
|
||||
}
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
{ #category : #'private - class factory' }
|
||||
HitchElement class >> getResponsibleElementClassFor: aTag [
|
||||
|
||||
^ self subclasses detect: [ :subclass | (subclass handlesTag: aTag) ] ifNone: [ self ]
|
||||
^ self allSubclasses
|
||||
detect: [ :subclass | subclass handlesTag: aTag ]
|
||||
ifNone: [ self ]
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
{ #category : #'private - class factory' }
|
||||
HitchElement class >> handlesTag: aTag [
|
||||
|
||||
^ false
|
||||
]
|
||||
|
||||
{ #category : #testing }
|
||||
HitchElement class >> isAbstract [
|
||||
|
||||
^ self == HitchElement
|
||||
^ SubclassResponsibility
|
||||
]
|
||||
|
||||
{ #category : #'instance creation' }
|
||||
|
|
Loading…
Reference in New Issue