diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-09-13 19:16:56 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-09-14 18:42:02 +0300 |
commit | 9e40baba1ebad260fa53b4a1de0c11e699d7c6a2 (patch) | |
tree | f6de30f8fc750fced4bc006895f00f2a0853029f /lib/gitlab/git/user.rb | |
parent | 1f5ae8cd8b3663ea2de883ec4605dc4100465bf4 (diff) |
Rename Gitlab::Git::Committer to User
Diffstat (limited to 'lib/gitlab/git/user.rb')
-rw-r--r-- | lib/gitlab/git/user.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/gitlab/git/user.rb b/lib/gitlab/git/user.rb new file mode 100644 index 00000000000..ea634d39668 --- /dev/null +++ b/lib/gitlab/git/user.rb @@ -0,0 +1,25 @@ +module Gitlab + module Git + class User + attr_reader :name, :email, :gl_id + + def self.from_gitlab(gitlab_user) + new(gitlab_user.name, gitlab_user.email, Gitlab::GlId.gl_id(gitlab_user)) + end + + def self.from_gitaly(gitaly_user) + new(gitaly_user.name, gitaly_user.email, gitaly_user.gl_id) + end + + def initialize(name, email, gl_id) + @name = name + @email = email + @gl_id = gl_id + end + + def ==(other) + [name, email, gl_id] == [other.name, other.email, other.gl_id] + end + end + end +end |