Sha256: 1e256e6bae40d9bc84d08b624b5cfd179acaf3cefffbc6ed42ad8371c00dd06b
Contents?: true
Size: 927 Bytes
Versions: 20
Compression:
Stored size: 927 Bytes
Contents
module Lita module GithubPrList class MergeRequest attr_accessor :id, :title, :state, :redis def initialize(params = {}) self.id = params[:id] self.title = params[:title] self.state = params[:state] self.redis = params[:redis] end def open? state == 'opened' end def handle if open? add_merge_request else remove_merge_request end end private def url "https://gitlab.corp.ads/ama/#{project}/merge_requests/#{id}" end def project 'rails_envs' end def emoji "(new)" end def message "#{project} #{emoji} #{title} #{url}" end def add_merge_request redis.set("gitlab_mr_#{id}", message) end def remove_merge_request redis.del("gitlab_mr_#{id}") end end end end
Version data entries
20 entries across 20 versions & 1 rubygems