for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# frozen_string_literal: true
# Class to define Alexa's intent behavior
class AlexaService
include AlexaConstants
attr_reader :user
def self.goodbye_response
GOODBYE_RESPONSE
end
def self.help_response
HELP_RESPONSE
def self.launch_response
LAUNCH_RESPONSE
def self.start_over_response
START_OVER_RESPONSE
def self.list_tests
format(LIST_TEST_RESPONSE, count: Instrument.count, list: Instrument.list_tests(limit: 4))
def self.start_test(testname: AppConstants::DEFAULT_INSTRUMENT)
instrument = Instrument.find_by(name: testname)
return format(AlexaConstants::CANNOT_FIND_INSTRUMENT_ERROR, instrument: testname) unless instrument
instrument.instructions
def initialize(user)
@user = user
def read_all
user.journal.list_entries(limit: 4)
def read_entry(day: Date.today)
user.journal.read_entry(day: day)
def read_last(last_n: 1)
user.journal.read_last(last_n)