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
|
||||
messages
|
||||
|
||||
messages ifNil: [ messages := TweetsCollection new ].
|
||||
messages ifEmpty: [ self getLocalMessages ].
|
||||
messages ifEmpty: [ self getRemoteMessagesFromHtml ].
|
||||
[ config at: 'reportingPeriod' ]
|
||||
onErrorDo: [ self config
|
||||
at: 'reportingPeriod'
|
||||
put: (Timespan
|
||||
starting: (messages oldest created asDateAndTime)
|
||||
ending: (messages newest created asDateAndTime + 1 minute)) ].
|
||||
^ messages select: [ :message | message created between: self reportingPeriod start and: self reportingPeriod end ]
|
||||
config at: 'reportingPeriod' ifAbsent: [ ^ messages ].
|
||||
"self configureDefaultReportingPeriod."
|
||||
^ messages
|
||||
select: [ :message |
|
||||
message created
|
||||
between: self reportingPeriod start
|
||||
and: self reportingPeriod end ]
|
Loading…
Reference in New Issue
Block a user