Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.26 KB | None | 0 0
  1. Time.zone = 'London'
  2.  
  3. def notification_times
  4.   Enumerator.new do |y|
  5.     [1, 2].each do | n|
  6.       y << n.hours.from_now
  7.     end
  8.   end
  9. end
  10.  
  11. puts notification_times.first # 2020-09-22 15:22:43 +0100
  12. puts notification_times.next # 2020-09-22 14:22:43 UTC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement