Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/time_iterator/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#up_to(time) ⇒ TimeIterator Also known as: down_to

Create new time iterator from ‘self` till specified `time`. Syntax sugar for (where `self` is `start`):

start = Time.new 1970, 1, 1
stop  = Time.new 1970, 2, 1

TimeIterator.new start, stop

Returns:



13
14
15
# File 'lib/time_iterator/core_ext.rb', line 13

def up_to time
  TimeIterator.new self, time
end