Class: Lita::Handlers::Manners
- Inherits:
-
Handler
- Object
- Handler
- Lita::Handlers::Manners
- Defined in:
- lib/lita/handlers/manners.rb
Instance Method Summary collapse
- #echo_command(response, message = nil) ⇒ Object
- #echo_message(response) ⇒ Object
- #sorry_command(response) ⇒ Object
- #sorry_message(response) ⇒ Object
- #thank_you_command(response) ⇒ Object
- #thank_you_message(response) ⇒ Object
Instance Method Details
#echo_command(response, message = nil) ⇒ Object
11 12 13 14 |
# File 'lib/lita/handlers/manners.rb', line 11 def echo_command(response, = nil) echo = || response.matches[0][0] response.reply "#{echo} #{response.user.name}" end |
#echo_message(response) ⇒ Object
16 17 18 19 |
# File 'lib/lita/handlers/manners.rb', line 16 def (response) = response.matches[0][0] echo_command(response, ) if addressed_to_robot?(response) end |
#sorry_command(response) ⇒ Object
29 30 31 |
# File 'lib/lita/handlers/manners.rb', line 29 def sorry_command(response) response.reply "Apology accepted #{response.user.name}" end |
#sorry_message(response) ⇒ Object
33 34 35 |
# File 'lib/lita/handlers/manners.rb', line 33 def (response) sorry_command(response) if addressed_to_robot?(response) end |
#thank_you_command(response) ⇒ Object
21 22 23 |
# File 'lib/lita/handlers/manners.rb', line 21 def thank_you_command(response) response.reply "You're welcome #{response.user.name}" end |
#thank_you_message(response) ⇒ Object
25 26 27 |
# File 'lib/lita/handlers/manners.rb', line 25 def (response) thank_you_command(response) if addressed_to_robot?(response) end |