Class: Timing::NaturalTimeLanguage::DayInterval

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/timing/natural_time_language_interpreters.rb

Instance Method Summary collapse

Instance Method Details

#beginning_of(time) ⇒ Object



235
236
237
# File 'lib/timing/natural_time_language_interpreters.rb', line 235

def beginning_of(time)
  time.beginning_of_day
end

#end_of(time) ⇒ Object



239
240
241
# File 'lib/timing/natural_time_language_interpreters.rb', line 239

def end_of(time)
  time.end_of_day
end

#time_after(time, number) ⇒ Object



231
232
233
# File 'lib/timing/natural_time_language_interpreters.rb', line 231

def time_after(time, number)
  time + Interval.days(number)
end

#time_ago(time, number) ⇒ Object



227
228
229
# File 'lib/timing/natural_time_language_interpreters.rb', line 227

def time_ago(time, number)
  time - Interval.days(number)
end