Class: JIJI::Dao::RateDao::RatesAggregator
Instance Attribute Summary
#start
Attributes inherited from Aggregator
#scale
Instance Method Summary
collapse
#flush, #next, #next_date
Methods inherited from Aggregator
#flush, #next
Constructor Details
Returns a new instance of RatesAggregator.
100
101
102
|
# File 'lib/jiji/dao/rate_dao.rb', line 100
def initialize( scale )
super
end
|
Instance Method Details
#aggregate(timed_data) ⇒ Object
103
104
105
106
107
108
109
|
# File 'lib/jiji/dao/rate_dao.rb', line 103
def aggregate( timed_data )
unless @rate
@rate = PeriodicallyRate.new
@rate.start_time = timed_data.time
end
@rate << timed_data
end
|
#aggregated ⇒ Object
110
111
112
113
114
115
116
|
# File 'lib/jiji/dao/rate_dao.rb', line 110
def aggregated
@rate.end_time = @end
vs = @rate
@rate = PeriodicallyRate.new
@rate.start_time = @end
return vs
end
|