Method: TimeMath::Sequence#next

Defined in:
lib/time_math/sequence.rb

#next(unit, span = 1) ⇒ Sequence

Non-destructive version of #next!.

Parameters:

  • unit (Symbol)
  • span (Numeric) (defaults to: 1)

    how many units to ceil to.

Returns:



178
179
180
181
182
183
184
185
186
187
# File 'lib/time_math/sequence.rb', line 178

Op::OPERATIONS.each do |operation|
  define_method "#{operation}!" do |*arg|
    @op.send("#{operation}!", *arg)
    self
  end

  define_method operation do |*arg|
    dup.send("#{operation}!", *arg)
  end
end