Class: Timing::NaturalTimeLanguage::WeekInterval

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



253
254
255
# File 'lib/timing/natural_time_language_interpreters.rb', line 253

def beginning_of(time)
  time.beginning_of_week
end

#end_of(time) ⇒ Object



257
258
259
# File 'lib/timing/natural_time_language_interpreters.rb', line 257

def end_of(time)
  time.end_of_week
end

#time_after(time, number) ⇒ Object



249
250
251
# File 'lib/timing/natural_time_language_interpreters.rb', line 249

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

#time_ago(time, number) ⇒ Object



245
246
247
# File 'lib/timing/natural_time_language_interpreters.rb', line 245

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