Accessors and first utilities.
This commit is contained in:
parent
bed5c107ee
commit
62fa2ab8b9
78
Apps/Holonica/HlPerson.class.st
Normal file
78
Apps/Holonica/HlPerson.class.st
Normal file
@ -0,0 +1,78 @@
|
||||
Class {
|
||||
#name : #HlPerson,
|
||||
#superclass : #Object,
|
||||
#instVars : [
|
||||
'givenName',
|
||||
'familyName',
|
||||
'metadata'
|
||||
],
|
||||
#category : #Holonica
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
HlPerson class >> fromListName [
|
||||
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
HlPerson class >> fromListName: aString [
|
||||
| allNames |
|
||||
allNames := aString substrings
|
||||
collect: [:each | each first asString, each allButFirst asLowercase ].
|
||||
allNames size = 4
|
||||
ifTrue: [
|
||||
^ self new
|
||||
givenName: allNames first, ' ', allNames second;
|
||||
familyName: allNames third, ' ', allNames fourth
|
||||
].
|
||||
allNames size = 3
|
||||
ifTrue: [
|
||||
^ self new
|
||||
givenName: allNames first, ' ', allNames second;
|
||||
familyName: allNames third.
|
||||
].
|
||||
allNames size = 2
|
||||
ifTrue: [
|
||||
^ self new
|
||||
givenName: allNames first;
|
||||
familyName: allNames second.
|
||||
].
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
HlPerson >> familyName [
|
||||
|
||||
^ familyName
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
HlPerson >> familyName: anObject [
|
||||
|
||||
familyName := anObject
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
HlPerson >> givenName [
|
||||
|
||||
^ givenName
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
HlPerson >> givenName: anObject [
|
||||
|
||||
givenName := anObject
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
HlPerson >> metadata [
|
||||
|
||||
^ metadata
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
HlPerson >> metadata: anObject [
|
||||
|
||||
metadata := anObject
|
||||
]
|
Loading…
Reference in New Issue
Block a user