Class: Lita::Standups::Wizards::RunStandup
- Inherits:
-
Wizard
- Object
- Wizard
- Lita::Standups::Wizards::RunStandup
- Defined in:
- lib/lita/standups/wizards/run_standup.rb
Instance Method Summary collapse
- #abort_wizard ⇒ Object
- #final_message ⇒ Object
- #finish_wizard ⇒ Object
- #initial_message ⇒ Object
- #response ⇒ Object
- #session ⇒ Object
- #standup ⇒ Object
- #start_wizard ⇒ Object
- #steps ⇒ Object
Instance Method Details
#abort_wizard ⇒ Object
33 34 35 36 |
# File 'lib/lita/standups/wizards/run_standup.rb', line 33 def abort_wizard response.aborted! response.save end |
#final_message ⇒ Object
49 50 51 |
# File 'lib/lita/standups/wizards/run_standup.rb', line 49 def "You're done. Thanks" end |
#finish_wizard ⇒ Object
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_message ⇒ Object
44 45 46 47 |
# File 'lib/lita/standups/wizards/run_standup.rb', line 44 def "Hey. I'm running the '#{standup.name}' standup. Please answer the following questions." \ " (this session expires in 1 hour)" end |
#response ⇒ Object
6 7 8 |
# File 'lib/lita/standups/wizards/run_standup.rb', line 6 def response @response ||= Models::StandupResponse[['response_id']] end |
#session ⇒ Object
10 11 12 |
# File 'lib/lita/standups/wizards/run_standup.rb', line 10 def session response.standup_session end |
#standup ⇒ Object
14 15 16 |
# File 'lib/lita/standups/wizards/run_standup.rb', line 14 def standup session.standup end |
#start_wizard ⇒ Object
28 29 30 31 |
# File 'lib/lita/standups/wizards/run_standup.rb', line 28 def start_wizard response.running! response.save end |
#steps ⇒ Object
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 |