Tweets collection now inherits from OrderedCollection to improve reusability.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-19 00:19:23 -05:00
parent b92102a9d1
commit 99a03c0ad1
5 changed files with 11 additions and 8 deletions

View File

@ -3,5 +3,7 @@ quotes
self messages ifEmpty: [ self getMessages ]. self messages ifEmpty: [ self getMessages ].
^ TweetsCollection new ^ TweetsCollection new
messages: (self messages messages select: [ :each | (each metadata at: 'quote') isNotEmpty ]); messages: (self messages messages
select: [ :each |
(each metadata at: 'quote') isNotEmpty and: [ each user userName = self userName] ]);
yourself yourself

View File

@ -1,3 +1,5 @@
accessing accessing
messages: aTweetsCollection messages: aTweetsCollection
^ messages := aTweetsCollection firstIndex := 1.
lastIndex := aTweetsCollection size.
^ array := aTweetsCollection

View File

@ -1,3 +1,3 @@
accessing accessing
messages messages
^ messages ifNil: [ messages := OrderedCollection new ] ^ array ifNil: [ array := OrderedCollection new ]

View File

@ -1,13 +1,12 @@
{ {
"commentStamp" : "", "commentStamp" : "",
"super" : "Object", "super" : "OrderedCollection",
"category" : "Socialmetrica", "category" : "Socialmetrica",
"classinstvars" : [ ], "classinstvars" : [ ],
"pools" : [ ], "pools" : [ ],
"classvars" : [ ], "classvars" : [ ],
"instvars" : [ "instvars" : [
"query", "query"
"messages"
], ],
"name" : "TweetsCollection", "name" : "TweetsCollection",
"type" : "normal" "type" : "normal"