-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ba-st/collections
Implement Collection Handling
- Loading branch information
Showing
8 changed files
with
329 additions
and
69 deletions.
There are no files selected for viewing
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,56 @@ | ||
" | ||
I'm a toy abstraction used just as an example | ||
" | ||
Class { | ||
#name : #Pet, | ||
#superclass : #Object, | ||
#instVars : [ | ||
'name', | ||
'type', | ||
'status' | ||
], | ||
#category : #'Stargate-Examples' | ||
} | ||
|
||
{ #category : #'instance creation' } | ||
Pet class >> named: aName ofType: aPetType [ | ||
|
||
^ self named: aName ofType: aPetType withStatus: 'new' | ||
] | ||
|
||
{ #category : #'instance creation' } | ||
Pet class >> named: aName ofType: aPetType withStatus: status [ | ||
|
||
^ self new initializeNamed: aName ofType: aPetType withStatus: status | ||
] | ||
|
||
{ #category : #initialization } | ||
Pet >> initializeNamed: aName ofType: aPetType withStatus: aStatus [ | ||
|
||
name := aName. | ||
type := aPetType. | ||
status := aStatus | ||
] | ||
|
||
{ #category : #accessing } | ||
Pet >> name [ | ||
^ name | ||
] | ||
|
||
{ #category : #accessing } | ||
Pet >> status [ | ||
^ status | ||
] | ||
|
||
{ #category : #updating } | ||
Pet >> synchronizeWith: aPet [ | ||
|
||
name := aPet name. | ||
type := aPet type. | ||
status := aPet status | ||
] | ||
|
||
{ #category : #accessing } | ||
Pet >> type [ | ||
^ type | ||
] |
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
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
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
Oops, something went wrong.