Class: Ask::Agent::ContextSources::Date

Inherits:
Ask::Agent::ContextSource show all
Defined in:
lib/ask/agent/context_sources.rb

Overview

Today's date in ISO 8601 format.

Instance Method Summary collapse

Methods inherited from Ask::Agent::ContextSource

inherited, key, #key, registered_sources

Instance Method Details

#baseline(date) ⇒ Object



76
77
78
# File 'lib/ask/agent/context_sources.rb', line 76

def baseline(date)
  "Today's date is #{date}."
end

#loadObject



72
73
74
# File 'lib/ask/agent/context_sources.rb', line 72

def load
  ::Date.today.iso8601
end

#update(prev, curr) ⇒ Object



80
81
82
# File 'lib/ask/agent/context_sources.rb', line 80

def update(prev, curr)
  "I previously said the date was #{prev}, but it is now #{curr}."
end