Class: Timing::NaturalTimeLanguage::BeginningEndInterval

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

Instance Method Summary collapse

Instance Method Details

#evaluate(zone_offset) ⇒ Object



79
80
81
82
83
84
85
86
# File 'lib/timing/natural_time_language_interpreters.rb', line 79

def evaluate(zone_offset)
  now = TimeInZone.now zone_offset
  if direction.beginning?
    interval_type.beginning_of now
  else
    interval_type.end_of now
  end
end