summaryrefslogtreecommitdiff
path: root/lib/gitlab/git/committer.rb
blob: 1f4bcf7a3a02c27142c62067e710cd875651bd5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Gitlab
  module Git
    class Committer
      attr_reader :name, :email, :gl_id

      def self.from_user(user)
        new(user.name, user.email, Gitlab::GlId.gl_id(user))
      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