Class: Timing::NaturalTimeLanguage::MomentAtTime

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



117
118
119
120
121
# File 'lib/timing/natural_time_language_interpreters.rb', line 117

def evaluate(zone_offset)
  now = TimeInZone.now zone_offset
  date = moment.evaluate zone_offset
  TimeInZone.parse "#{date.strftime('%F')} #{time.value} #{now.zone_offset}"
end