class TimeMath::ArrayResampler

@private

Public Class Methods

new(unit, array) click to toggle source
Calls superclass method TimeMath::Resampler::new
# File lib/time_math/resamplers.rb, line 38
def initialize(unit, array)
  super(unit)
  @array = array
end
try(unit, array) click to toggle source
# File lib/time_math/resamplers.rb, line 32
def self.try(unit, array)
  return nil unless array.is_a?(Array) && array.all?(&Util.method(:timey?))

  new(unit, array)
end

Public Instance Methods

call(*) click to toggle source
# File lib/time_math/resamplers.rb, line 43
def call(*)
  sequence.to_a
end

Private Instance Methods

timestamps() click to toggle source
# File lib/time_math/resamplers.rb, line 49
def timestamps
  @array
end