Class: Lita::Standups::Wizards::ScheduleStandup

Inherits:
Wizard
  • Object
show all
Defined in:
lib/lita/standups/wizards/schedule_standup.rb

Instance Method Summary collapse

Instance Method Details

#final_messageObject



38
39
40
41
42
43
44
# File 'lib/lita/standups/wizards/schedule_standup.rb', line 38

def final_message
  [
    "You're done! Below is the summary of your scheduled standup:",
    ">>>",
    @schedule.description
  ].join("\n")
end

#finish_wizardObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/lita/standups/wizards/schedule_standup.rb', line 26

def finish_wizard
  @schedule = Models::StandupSchedule.create(
    standup: standup,
    repeat: value_for(:repeat),
    day_of_week: value_for(:day_of_week),
    time: value_for(:time),
    recipients: value_for(:recipients).to_s.gsub("@", "").split(/[\s,\n]/m).map(&:strip).map(&:presence).compact,
    channel: value_for(:channel)
  )
  robot.schedule_standup(@schedule)
end

#standupObject



46
47
48
# File 'lib/lita/standups/wizards/schedule_standup.rb', line 46

def standup
  @standup ||= Models::Standup[meta['standup_id']]
end