Class: Lita::Standups::Wizards::RunStandup

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

Instance Method Summary collapse

Instance Method Details

#abort_wizardObject



33
34
35
36
# File 'lib/lita/standups/wizards/run_standup.rb', line 33

def abort_wizard
  response.aborted!
  response.save
end

#final_messageObject



49
50
51
# File 'lib/lita/standups/wizards/run_standup.rb', line 49

def final_message
  "You're done. Thanks"
end

#finish_wizardObject



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

def finish_wizard
  response.completed!
  response.answers = values
  response.save
end

#initial_messageObject



44
45
46
47
# File 'lib/lita/standups/wizards/run_standup.rb', line 44

def initial_message
  "Hey. I'm running the '#{standup.name}' standup. Please answer the following questions." \
    " (this session expires in 1 hour)"
end

#responseObject



6
7
8
# File 'lib/lita/standups/wizards/run_standup.rb', line 6

def response
  @response ||= Models::StandupResponse[meta['response_id']]
end

#sessionObject



10
11
12
# File 'lib/lita/standups/wizards/run_standup.rb', line 10

def session
  response.standup_session
end

#standupObject



14
15
16
# File 'lib/lita/standups/wizards/run_standup.rb', line 14

def standup
  session.standup
end

#start_wizardObject



28
29
30
31
# File 'lib/lita/standups/wizards/run_standup.rb', line 28

def start_wizard
  response.running!
  response.save
end

#stepsObject



18
19
20
21
22
23
24
25
26
# File 'lib/lita/standups/wizards/run_standup.rb', line 18

def steps
  @steps ||= standup.questions.map.with_index(1) do |question, index|
    OpenStruct.new(
      name: "q#{index}",
      label: question,
      multiline: true
    )
  end
end