Class: Timely::TemporalPatterns::Finder
- Inherits:
-
Object
- Object
- Timely::TemporalPatterns::Finder
- Defined in:
- lib/timely/temporal_patterns/finder.rb
Class Method Summary collapse
Class Method Details
.patterns(datetimes, options = nil) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/timely/temporal_patterns/finder.rb', line 5 def patterns(datetimes, = nil) return [] if datetimes.blank? ||= {} datetimes = Array.wrap(datetimes).uniq.map(&:to_datetime).sort if [:split].is_a?(ActiveSupport::Duration) find_patterns_split_by_duration(datetimes, ) elsif [:split].is_a?(Numeric) find_patterns_split_by_size(datetimes, ) else find_patterns(datetimes, ) end end |