Socialmetrica/Socialmetrica.package/TweetsCollection.class/instance/newestOf..st

7 lines
309 B
Smalltalk
Raw Normal View History

2022-05-04 01:50:20 +00:00
accessing
newestOf: userId
self messages ifNil: [ ^ nil ].
self messages ifEmpty: [ ^ nil ].
^ ((self select: [ :tweet | tweet authorId = userId ])
select: [ :tweet | tweet created = (((self select: [ :each | each authorId = userId ]) collect: [ :each | each created ]) asSortedCollection last)]) first