gitlab-org--gitlab-foss/lib/gitlab/gitaly_client/diff.rb

22 lines
437 B
Ruby
Raw Normal View History

2017-05-30 15:30:05 -04:00
module Gitlab
module GitalyClient
class Diff
FIELDS = %i(from_path to_path old_mode new_mode from_id to_id patch).freeze
attr_accessor(*FIELDS)
def initialize(params)
params.each do |key, val|
public_send(:"#{key}=", val)
end
end
def ==(other)
FIELDS.all? do |field|
public_send(field) == other.public_send(field)
end
end
end
end
end