Module: DateUtil

Defined in:
lib/nacofetch/date_util.rb

Constant Summary collapse

LEFT_SIDE_LATER =
1
RIGHT_SIDE_LATER =
-1

Instance Method Summary collapse

Instance Method Details

#after?(input_time) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/nacofetch/date_util.rb', line 17

def after?(input_time)
  (self <=> input_time) == LEFT_SIDE_LATER
end

#before?(input_time) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/nacofetch/date_util.rb', line 13

def before?(input_time)
  (self <=> input_time) == RIGHT_SIDE_LATER
end