Class: ZeroFill
- Inherits:
-
Object
- Object
- ZeroFill
- Defined in:
- lib/zero_fill.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ArraySeries, HashSeries
Class Method Summary collapse
-
.by_date(series, options = {}) ⇒ Object
by_date is a factory.
Instance Method Summary collapse
Class Method Details
.by_date(series, options = {}) ⇒ Object
by_date is a factory
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/zero_fill.rb', line 5 def self.by_date(series, ={}) return series if series.empty? && !() if series.is_a? Hash zf = ZeroFill::HashSeries.new(series, ) elsif series.is_a? Array zf = ZeroFill::ArraySeries.new(series, ) else raise TypeError, "Date series must be a hash or array" end zf.series_by_date end |
Instance Method Details
#series_by_date ⇒ Object
18 19 20 21 22 |
# File 'lib/zero_fill.rb', line 18 def series_by_date populate_new_series reverse_series! if [:order].to_sym == :descending @new_series end |