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
-
#initialize(robot) ⇒ SlackStandup
constructor
A new instance of SlackStandup.
- #reminder ⇒ Object
- #standup_end(message = nil) ⇒ Object
- #standup_ignore(message) ⇒ Object
- #standup_list(message) ⇒ Object
- #standup_next(message = nil) ⇒ Object
- #standup_report(message) ⇒ Object
- #standup_start(message = nil) ⇒ Object
- #standup_unignore(message) ⇒ Object
Methods included from SlackClient
Constructor Details
#initialize(robot) ⇒ SlackStandup
Returns a new instance of SlackStandup.
8 9 10 11 |
# File 'lib/lita/handlers/slack_standup.rb', line 8 def initialize(robot) super setup_redis_objects end |
Instance Method Details
#reminder ⇒ Object
45 46 47 48 49 |
# File 'lib/lita/handlers/slack_standup.rb', line 45 def reminder standup_members.each do |user, standup| ("@#{user}", t("sentence.reminder", user: user)) if standup.empty? end end |
#standup_end(message = nil) ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/lita/handlers/slack_standup.rb', line 88 def standup_end(=nil) in_standup.value = 'false' update_ids_to_members update_standup_members end |
#standup_ignore(message) ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/lita/handlers/slack_standup.rb', line 53 def standup_ignore() user = extract_user() unless ignored_members.include? user ignored_members << user standup_members.delete(user) end .reply(t("sentence.ignore", user: user)) end |
#standup_list(message) ⇒ Object
79 80 81 82 83 84 |
# File 'lib/lita/handlers/slack_standup.rb', line 79 def standup_list() .reply(ignored_members.inject(t("sentence.list")) do |reply, user| reply += "#{user} " end ) end |
#standup_next(message = nil) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/lita/handlers/slack_standup.rb', line 33 def standup_next(=nil) return unless standup_check? if standup_members.none? { |user, standup| standup.empty? } standup_end else next_attendee = select_next_standup (config.channel, t("sentence.next", user: next_attendee)) fill_standup(next_attendee) end end |
#standup_report(message) ⇒ Object
26 27 28 29 |
# File 'lib/lita/handlers/slack_standup.rb', line 26 def standup_report() save_standup .reply(t("sentence.report")) end |
#standup_start(message = nil) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/lita/handlers/slack_standup.rb', line 15 def standup_start(=nil) return if already_started? in_standup.value = 'true' (config.channel, t("sentence.start")) prewritten_standups_summary standup_next end |
#standup_unignore(message) ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/lita/handlers/slack_standup.rb', line 66 def standup_unignore() user = extract_user() if ignored_members.include? user ignored_members.delete(user) standup_members[user] = '' end .reply(t("sentence.unignore",user: user)) end |