Method: TimeCalc::Value#step

Defined in:
lib/time_calc/value.rb

#step(unit) ⇒ Sequence #step(span, unit) ⇒ Sequence

Produces endless Sequence from this value, with step specified.

Overloads:

  • #step(unit) ⇒ Sequence

    Shortcut for ‘step(1, unit)`

    Parameters:

    • unit (Symbol)
  • #step(span, unit) ⇒ Sequence

    Parameters:

    • span (Integer)
    • unit (Symbol)

Returns:



214
215
216
217
# File 'lib/time_calc/value.rb', line 214

def step(span, unit = nil)
  span, unit = 1, span if unit.nil?
  Sequence.new(from: self).step(span, unit)
end