Sha256: 1791bbaac34d696f81723c76b74a44c89384654a5f318dd5328081f0d6ca0972

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

module Lita
  module Standups
    module Wizards
      class RunStandup < Lita::Wizard

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

        def session
          response.standup_session
        end

        def standup
          session.standup
        end

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

        def start_wizard
          response.running!
          response.save
        end

        def abort_wizard
          response.aborted!
          response.save
        end

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

        def initial_message
          "Hey. I'm running the '#{standup.name}' standup. Please answer the following questions."
        end

        def final_message
          "You're done. Thanks"
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lita-standups-1.0.3 lib/lita/standups/wizards/run_standup.rb
lita-standups-1.0.2 lib/lita/standups/wizards/run_standup.rb