Class: ReqSample::Time

Inherits:
Time
  • Object
show all
Defined in:
lib/reqsample/time.rb

Overview

Custom Time methods

Instance Method Summary collapse

Instance Method Details

#within(center, limit) ⇒ Object



4
5
6
7
# File 'lib/reqsample/time.rb', line 4

def within(center, limit)
  seconds_range = limit * 60 * 60
  (center - seconds_range) <= self && self <= (center + seconds_range)
end