2019-10-10 08:06:19 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class DiffFileMetadataEntity < Grape::Entity
|
|
|
|
expose :added_lines
|
|
|
|
expose :removed_lines
|
|
|
|
expose :new_path
|
|
|
|
expose :old_path
|
|
|
|
expose :new_file?, as: :new_file
|
|
|
|
expose :deleted_file?, as: :deleted_file
|
2019-11-26 04:08:36 -05:00
|
|
|
expose :file_hash do |diff_file|
|
|
|
|
Digest::SHA1.hexdigest(diff_file.file_path)
|
|
|
|
end
|
2019-10-10 08:06:19 -04:00
|
|
|
end
|