Skip to content

Commit

Permalink
cleaning up encyclopedia model
Browse files Browse the repository at this point in the history
  • Loading branch information
astares committed Jun 26, 2023
1 parent fe2fb8b commit 3491b74
Show file tree
Hide file tree
Showing 9 changed files with 429 additions and 258 deletions.
29 changes: 21 additions & 8 deletions src/Glorp-Unit-Tests/GlorpEncyclopedia.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
An encyclopedia in the Encyclopedia model
"
Class {
#name : #GlorpEncyclopedia,
#superclass : #Object,
Expand All @@ -21,36 +24,43 @@ GlorpEncyclopedia class >> example1 [

{ #category : #accessing }
GlorpEncyclopedia >> articleAt: aString put: anEntry [
entries at: aString put: anEntry.

entries at: aString put: anEntry
]

{ #category : #accessing }
GlorpEncyclopedia >> biographicalEntries [
^biographicalEntries

^ biographicalEntries
]

{ #category : #accessing }
GlorpEncyclopedia >> biographicalEntries: aDictionary [

biographicalEntries := aDictionary
]

{ #category : #accessing }
GlorpEncyclopedia >> entries [
^entries.

^ entries
]

{ #category : #accessing }
GlorpEncyclopedia >> entries: aDictionary [

entries := aDictionary
]

{ #category : #accessing }
GlorpEncyclopedia >> id [
^id

^ id
]

{ #category : #accessing }
GlorpEncyclopedia >> id: anInteger [

id := anInteger
]

Expand All @@ -64,18 +74,21 @@ GlorpEncyclopedia >> initialize [

{ #category : #accessing }
GlorpEncyclopedia >> name [
^name

^ name
]

{ #category : #accessing }
GlorpEncyclopedia >> name: aString [

name := aString
]

{ #category : #accessing }
{ #category : #printing }
GlorpEncyclopedia >> printOn: aStream [

super printOn: aStream.
aStream nextPut: $(.
name isNil ifFalse: [aStream nextPutAll: name].
aStream nextPut: $).
name ifNotNil: [ aStream nextPutAll: name ].
aStream nextPut: $)
]
11 changes: 9 additions & 2 deletions src/Glorp-Unit-Tests/GlorpEncyclopediaBioEntry.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
An encyclopedia bio entry in the Encyclopedia model
"
Class {
#name : #GlorpEncyclopediaBioEntry,
#superclass : #Object,
Expand All @@ -11,20 +14,24 @@ Class {

{ #category : #accessing }
GlorpEncyclopediaBioEntry >> text [
^text

^ text
]

{ #category : #accessing }
GlorpEncyclopediaBioEntry >> text: anObject [

text := anObject
]

{ #category : #accessing }
GlorpEncyclopediaBioEntry >> title [
^title

^ title
]

{ #category : #accessing }
GlorpEncyclopediaBioEntry >> title: anObject [

title := anObject
]
Loading

0 comments on commit 3491b74

Please sign in to comment.