Class: JIJI::Dao::TradeResultDao::TradeAggregator
- Inherits:
-
AbstractAggregator
- Object
- Aggregator
- AbstractAggregator
- JIJI::Dao::TradeResultDao::TradeAggregator
- Defined in:
- lib/jiji/dao/trade_result_dao.rb
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Attributes inherited from AbstractAggregator
Attributes inherited from Aggregator
Instance Method Summary collapse
Methods inherited from AbstractAggregator
#flush, #initialize, #next, #next_date
Methods inherited from Aggregator
Constructor Details
This class inherits a constructor from JIJI::Dao::AbstractAggregator
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
122 123 124 |
# File 'lib/jiji/dao/trade_result_dao.rb', line 122 def values @values end |
Instance Method Details
#aggregate(timed_data) ⇒ Object
109 110 111 112 |
# File 'lib/jiji/dao/trade_result_dao.rb', line 109 def aggregate( timed_data ) @values = Set.new unless @values @values += timed_data.values[0] end |
#aggregated ⇒ Object
113 114 115 116 117 118 119 120 121 |
# File 'lib/jiji/dao/trade_result_dao.rb', line 113 def aggregated begin str = @values.to_a.join(" ") return BasicTimedData.new( [str] \ + [@start.to_i, @end.to_i], @end) ensure @values.clear if @values end end |