Class: Lita::Standups::Wizards::CreateStandup

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

Instance Method Summary collapse

Instance Method Details

#final_messageObject



24
25
26
27
28
29
30
# File 'lib/lita/standups/wizards/create_standup.rb', line 24

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

#finish_wizardObject



15
16
17
18
19
20
21
22
# File 'lib/lita/standups/wizards/create_standup.rb', line 15

def finish_wizard
  Lita.logger.debug "Finishing wizard CreateStandup for user #{user_id}"
  @standup = Models::Standup.create(
    name: value_for(:name),
    questions: value_for(:questions).to_s.split("\n").map(&:strip).map(&:presence).compact
  )
  Lita.logger.debug "Created standup: #{@standup.summary}"
end