Class: Socrates::SampleStates::CalculateAge

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

Instance Attribute Summary

Attributes included from Core::State

#adapter, #data, #session, #user

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



124
125
126
127
128
129
# File 'lib/socrates/sample_states.rb', line 124

def ask
  respond message: "Got it #{first_name}! So that makes you #{calculate_age} years old."

  # Example of a :ask => :ask transition.
  transition_to :end_conversation_1
end