Class: Lita::Handlers::SlackStandup
- Inherits:
-
Handler
- Object
- Handler
- Lita::Handlers::SlackStandup
- Includes:
- SlackClient
- Defined in:
- lib/lita/handlers/slack_standup.rb
Instance Method Summary collapse
- #ignore(message) ⇒ Object
- #list_ignore(message) ⇒ Object
- #next_standup(message = nil) ⇒ Object
- #reminder ⇒ Object
- #standup(message) ⇒ Object
- #start_standup(message = nil) ⇒ Object
- #unignore(message) ⇒ Object
Methods included from SlackClient
Instance Method Details
#ignore(message) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/lita/handlers/slack_standup.rb', line 50 def ignore() user = .matches[0][0].gsub('@','') unless ignored_members.include? user ignored_members << user standup_members.delete(user) end .reply("<@#{user}> est désormais ignoré jusqu'à nouvel ordre.") end |
#list_ignore(message) ⇒ Object
72 73 74 75 76 77 78 |
# File 'lib/lita/handlers/slack_standup.rb', line 72 def list_ignore() reply = "Utilisateurs ignorés : " ignored_members.each do |user| reply += "#{user} " end .reply(reply) end |
#next_standup(message = nil) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lita/handlers/slack_standup.rb', line 28 def next_standup(=nil) if in_standup.value == 'true' if standup_members.none? { |user, standup| standup.empty? } end_standup else next_attendee = select_next_standup (config.channel,"Bonjour <@#{next_attendee}> ! C'est à ton tour de parler.") fill_standup(next_attendee) end else (config.channel,"La commande n'est pas disponible en dehors d'un standup.") end end |
#reminder ⇒ Object
42 43 44 45 46 |
# File 'lib/lita/handlers/slack_standup.rb', line 42 def reminder standup_members.each do |user, standup| ("@#{user}","Bonsoir <@#{user}> ! Tu peux donner ton standup pour demain. !standup 3615mavie") if standup.empty? end end |
#standup(message) ⇒ Object
20 21 22 23 24 |
# File 'lib/lita/handlers/slack_standup.rb', line 20 def standup() setup_redis_objects save_standup .reply("Ton standup est enregistré. Merci :)") end |
#start_standup(message = nil) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/lita/handlers/slack_standup.rb', line 10 def start_standup(=nil) in_standup.value = 'true' setup_redis_objects (config.channel, 'Hello <!channel> ! Le standup va commencer : )') prewritten_standups_summary next_standup end |
#unignore(message) ⇒ Object
61 62 63 64 65 66 67 68 |
# File 'lib/lita/handlers/slack_standup.rb', line 61 def unignore() user = .matches[0][0].gsub('@','') if ignored_members.include? user ignored_members.delete(user) standup_members[user] = '' end .reply("<@#{user}> est à nouveau inclus dans les standups.") end |