Class: Eventual::TimeRange

Inherits:
Time
  • Object
show all
Defined in:
lib/eventual/syntax_nodes.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Time

#hour, #minute, #to_i, #value

Instance Method Details

#include?(date) ⇒ Boolean

Returns:

  • (Boolean)


245
246
247
# File 'lib/eventual/syntax_nodes.rb', line 245

def include? date
  (first.to_i..last.to_i).include? date.strftime("%H%M").to_i
end

#make(year, month, day) ⇒ Object



239
240
241
242
243
# File 'lib/eventual/syntax_nodes.rb', line 239

def make year, month, day
  first_time = DateTime.civil year, month, day, first.hour, first.minute
  last_time  = DateTime.civil year, month, day, last.hour,  last.minute
  (first_time..last_time)
end