Class: Socrates::SampleStates::Help

Inherits:
Object
  • Object
show all
Includes:
Core::State
Defined in:
lib/socrates/sample_states.rb

Instance Attribute Summary

Attributes included from Core::State

#context, #data

Instance Method Summary collapse

Methods included from Core::State

#end_conversation, #initialize, #listen, #next_state_action, #next_state_id, #repeat_action, #respond, #send_message, #transition_to

Instance Method Details

#askObject



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/socrates/sample_states.rb', line 40

def ask
  respond message: <<~MSG
    Thanks for asking! I can do these things for you...

      • `age` - Calculate your age from your birth date.
      • `error` - Start a short error path that raises an error.
      • `help` - Tell you what I can do for you.

    So, what shall it be?
  MSG

  transition_to :get_started, action: :listen
end