Sha256: eeebe94d5ccdf2768688a12176934557acc2002f6905bba6bcdca251660cf959

Contents?: true

Size: 608 Bytes

Versions: 28

Compression:

Stored size: 608 Bytes

Contents

module Lita
  module GithubPrList
    class AliasUser
      attr_accessor :response, :redis

      def initialize(params = {})
        self.response = params.fetch(:response, nil)
        self.redis = params.fetch(:redis, nil)
        raise "invalid params in #{self.class.name}" if response.nil? || redis.nil?
      end

      def create_alias
        github_username, hipchat_username = response.matches.first[0], response.matches.first[1]
        redis.set("alias:#{github_username}", hipchat_username)
        response.reply "Mapped #{github_username} to #{hipchat_username}"
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
lita-github_pr_list-0.0.9 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.8 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.7 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.6 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.5 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.4 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.2 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.1 lib/lita/github_pr_list/alias_user.rb