2017-05-30 15:30:05 -04:00
|
|
|
module Gitlab
|
|
|
|
module GitalyClient
|
|
|
|
class Diff
|
2017-07-13 18:22:09 -04:00
|
|
|
FIELDS = %i(from_path to_path old_mode new_mode from_id to_id patch overflow_marker collapsed).freeze
|
2017-05-30 15:30:05 -04:00
|
|
|
|
|
|
|
attr_accessor(*FIELDS)
|
|
|
|
|
|
|
|
def initialize(params)
|
|
|
|
params.each do |key, val|
|
2017-08-03 22:20:34 -04:00
|
|
|
public_send(:"#{key}=", val) # rubocop:disable GitlabSecurity/PublicSend
|
2017-05-30 15:30:05 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def ==(other)
|
|
|
|
FIELDS.all? do |field|
|
2017-08-03 22:20:34 -04:00
|
|
|
public_send(field) == other.public_send(field) # rubocop:disable GitlabSecurity/PublicSend
|
2017-05-30 15:30:05 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|