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
created
^ created
^ created ifNotNil: [ ^ ZTimestamp fromString: created ]

View File

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

View File

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

View File

@ -1,7 +1,7 @@
accessing
newest
self messages ifNil: [ ^ nil ].
self messages ifNilEmpty: [ ^ nil ].
self messages ifEmpty: [ ^ nil ].
self pinned created > self messages second created
ifTrue: [ ^ self pinned ]
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" : [ ],
"classvars" : [ ],
"instvars" : [
"tweets",
"query"
"query",
"messages"
],
"name" : "TweetsCollection",
"type" : "normal"