Class: Timing::NaturalTimeLanguage::HourInterval

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



217
218
219
# File 'lib/timing/natural_time_language_interpreters.rb', line 217

def beginning_of(time)
  time.beginning_of_hour
end

#end_of(time) ⇒ Object



221
222
223
# File 'lib/timing/natural_time_language_interpreters.rb', line 221

def end_of(time)
  time.end_of_hour
end

#time_after(time, number) ⇒ Object



213
214
215
# File 'lib/timing/natural_time_language_interpreters.rb', line 213

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

#time_ago(time, number) ⇒ Object



209
210
211
# File 'lib/timing/natural_time_language_interpreters.rb', line 209

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