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.3.2 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.3.1 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.3.0 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.2.2 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.2.1 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.2.0 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.1.3 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.1.2 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.1.1 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.1.0 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.21 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.20 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.19 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.16 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.15 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.14 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.13 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.12 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.11 lib/lita/github_pr_list/alias_user.rb
lita-github_pr_list-0.0.10 lib/lita/github_pr_list/alias_user.rb