Refactoring messages.
This commit is contained in:
parent
43662d3fce
commit
57186f444f
@ -0,0 +1,8 @@
|
|||||||
|
accessing
|
||||||
|
configureDefaultReportingPeriod
|
||||||
|
[ config at: 'reportingPeriod' ]
|
||||||
|
onErrorDo: [ self config
|
||||||
|
at: 'reportingPeriod'
|
||||||
|
put: (Timespan
|
||||||
|
starting: messages oldest created asDateAndTime
|
||||||
|
ending: messages newest created asDateAndTime + 1 minute) ]
|
@ -1,13 +1,12 @@
|
|||||||
accessing
|
accessing
|
||||||
messages
|
messages
|
||||||
|
|
||||||
messages ifNil: [ messages := TweetsCollection new ].
|
messages ifNil: [ messages := TweetsCollection new ].
|
||||||
messages ifEmpty: [ self getLocalMessages ].
|
messages ifEmpty: [ self getLocalMessages ].
|
||||||
messages ifEmpty: [ self getRemoteMessagesFromHtml ].
|
messages ifEmpty: [ self getRemoteMessagesFromHtml ].
|
||||||
[ config at: 'reportingPeriod' ]
|
config at: 'reportingPeriod' ifAbsent: [ ^ messages ].
|
||||||
onErrorDo: [ self config
|
"self configureDefaultReportingPeriod."
|
||||||
at: 'reportingPeriod'
|
^ messages
|
||||||
put: (Timespan
|
select: [ :message |
|
||||||
starting: (messages oldest created asDateAndTime)
|
message created
|
||||||
ending: (messages newest created asDateAndTime + 1 minute)) ].
|
between: self reportingPeriod start
|
||||||
^ messages select: [ :message | message created between: self reportingPeriod start and: self reportingPeriod end ]
|
and: self reportingPeriod end ]
|
Loading…
Reference in New Issue
Block a user