Sha256: 00d53a37f23a4bc78118d45b1e8432e9928f8d62e5d26b2e2d25bfef62dbe0f0

Contents?: true

Size: 733 Bytes

Versions: 2

Compression:

Stored size: 733 Bytes

Contents

module Ruboty
  module Jira
    module Actions
      class AssociateProject < Base
        def call
          associate_project
          replay_message
        rescue => e
          message.reply(e.message)
        end

        private

        def associate_project
          project = find_project(project_key)
          return if project.nil?

          projects[message.to] = {
            id: project.id
          }
        end

        def project_key
          message[:project]
        end

        def replay_message
          if associate_project.nil?
            message.reply('The jira project is not found.')
          else
            message.reply('Registered.')
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruboty-jira-0.3.0 lib/ruboty/jira/actions/associate_project.rb
ruboty-jira-0.2.0 lib/ruboty/jira/actions/associate_project.rb