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



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

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

#loadObject



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

def load
  ::Date.today.iso8601
end

#update(prev, curr) ⇒ Object



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

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