Class: Responders::Introduction
- Inherits:
-
ApplicationResponder
- Object
- Bot::Responder
- ApplicationResponder
- Responders::Introduction
- Defined in:
- lib/generators/bot/install/templates/introduction_responder.rb
Instance Attribute Summary
Attributes inherited from Bot::Responder
#analytics, #chat_context, #handler, #message, #responses, #user, #user_context
Instance Method Summary collapse
Methods inherited from Bot::Responder
#can_respond_to_type?, #initialize, respond_to
Constructor Details
This class inherits a constructor from Bot::Responder
Instance Method Details
#can_handle? ⇒ Boolean
5 6 7 |
# File 'lib/generators/bot/install/templates/introduction_responder.rb', line 5 def can_handle? !user.introduced? end |
#handle ⇒ Object
9 10 11 12 13 14 |
# File 'lib/generators/bot/install/templates/introduction_responder.rb', line 9 def handle user.introduced = true user.save! reexecute_with(text_response('Hello!')) end |