-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enh]: Fix Issue #27: All Option Descriptions Should Be Extensible; n…
…ow MultipleOptionDescriptions can be #extensible, too! Implementation note: #initializer had to be pushed up, since we need to supply a way to create the new instance. This pushes us a bit closer to my suspicion that #classes for reference descriptions should be #factories, which would probably mean a name-change for #initializer
- Loading branch information
1 parent
acf0bec
commit 039957b
Showing
16 changed files
with
20 additions
and
11 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
source/Magritte-Model.package/MAMultipleOptionDescription.class/instance/validateKind..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
validating | ||
validateKind: anObject | ||
super validateKind: anObject. | ||
(anObject allSatisfy: [ :each | self options includes: each ]) | ||
ifFalse: [ MAKindError description: self signal: self kindErrorMessage ] | ||
anObject do: [ :e | self validateOptionKind: e ] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
source/Magritte-Model.package/MAOptionDescription.class/instance/shouldNotInclude..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-dynamic | ||
shouldNotInclude: anObject | ||
^ anObject isNil or: [ self options includes: anObject ] | ||
^ self isExtensible not or: [ anObject isNil or: [ self options includes: anObject ] ] |
7 changes: 7 additions & 0 deletions
7
source/Magritte-Model.package/MAOptionDescription.class/instance/validateOptionKind..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
validating | ||
validateOptionKind: anObject | ||
(self options includes: anObject) | ||
ifTrue: [ ^ self ]. | ||
self isExtensible | ||
ifTrue: [ self reference validate: anObject ] | ||
ifFalse: [ MAKindError description: self signal: self kindErrorMessage ] |
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions
3
source/Magritte-Model.package/MASingleOptionDescription.class/instance/shouldNotInclude..st
This file was deleted.
Oops, something went wrong.
6 changes: 1 addition & 5 deletions
6
source/Magritte-Model.package/MASingleOptionDescription.class/instance/validateKind..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
validating | ||
validateKind: anObject | ||
super validateKind: anObject. | ||
(self options includes: anObject) | ||
ifTrue: [ ^ self ]. | ||
self isExtensible | ||
ifTrue: [ self reference validate: anObject ] | ||
ifFalse: [ MAKindError description: self signal: self kindErrorMessage ] | ||
self validateOptionKind: anObject |
7 changes: 7 additions & 0 deletions
7
source/Magritte-Model.package/NumberParser.extension/class/isNumber..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
*Magritte-Model | ||
isNumber: aStringOrStream | ||
|
||
| stream | | ||
stream := aStringOrStream readStream. | ||
NumberParser parse: stream onError: [ ^ false ]. | ||
^ stream atEnd |
3 changes: 3 additions & 0 deletions
3
source/Magritte-Model.package/NumberParser.extension/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name" : "NumberParser" | ||
} |