Initial methods for tweets histogram.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-15 00:05:17 -05:00
parent d61490e96c
commit 0da5c06527
7 changed files with 22 additions and 6 deletions

View File

@ -0,0 +1,8 @@
accessing
belongsToSegment: segmentBodersCollection
segmentBodersCollection allButLast keysAndValuesDo: [ :i :elem |
(elem < self created and: [ self created <= (segmentBodersCollection at: i + 1) ])
ifTrue: [ ^ i ]
].
^ false

View File

@ -1,3 +1,3 @@
accessing accessing
created created
^ created ^ created ifNotNil: [ ^ ZTimestamp fromString: created ]

View File

@ -1,3 +1,3 @@
accessing accessing
messages: aTweetsCollection messages: aTweetsCollection
^ tweets := aTweetsCollection ^ messages := aTweetsCollection

View File

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

View File

@ -1,7 +1,7 @@
accessing accessing
newest newest
self messages ifNil: [ ^ nil ]. self messages ifNil: [ ^ nil ].
self messages ifNilEmpty: [ ^ nil ]. self messages ifEmpty: [ ^ nil ].
self pinned created > self messages second created self pinned created > self messages second created
ifTrue: [ ^ self pinned ] ifTrue: [ ^ self pinned ]
ifFalse: [ ^ self messages second ] ifFalse: [ ^ self messages second ]

View File

@ -0,0 +1,8 @@
accessing
pinned
| first second |
first := self messages first.
(first metadata at: 'pinned') = 1
ifFalse: [ ^ first ].
second := self messages second.
^ first created

View File

@ -6,8 +6,8 @@
"pools" : [ ], "pools" : [ ],
"classvars" : [ ], "classvars" : [ ],
"instvars" : [ "instvars" : [
"tweets", "query",
"query" "messages"
], ],
"name" : "TweetsCollection", "name" : "TweetsCollection",
"type" : "normal" "type" : "normal"