Class: Gitlab::Git::RawDiffChange
- Inherits:
-
Object
- Object
- Gitlab::Git::RawDiffChange
- Defined in:
- lib/gitlab/git/raw_diff_change.rb
Overview
This class behaves like a struct with fields :blob_id, :blob_size, :operation, :old_path, :new_path All those fields are (binary) strings or integers
Instance Attribute Summary collapse
-
#blob_id ⇒ Object
readonly
Returns the value of attribute blob_id.
-
#blob_size ⇒ Object
readonly
Returns the value of attribute blob_size.
-
#new_path ⇒ Object
readonly
Returns the value of attribute new_path.
-
#old_path ⇒ Object
readonly
Returns the value of attribute old_path.
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
Instance Method Summary collapse
-
#initialize(raw_change) ⇒ RawDiffChange
constructor
A new instance of RawDiffChange.
Constructor Details
#initialize(raw_change) ⇒ RawDiffChange
Returns a new instance of RawDiffChange.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gitlab/git/raw_diff_change.rb', line 10 def initialize(raw_change) if raw_change.is_a?(Gitaly::GetRawChangesResponse::RawChange) @blob_id = raw_change.blob_id @blob_size = raw_change.size @old_path = raw_change.old_path_bytes.presence @new_path = raw_change.new_path_bytes.presence @operation = raw_change.operation&.downcase || :unknown else parse(raw_change) end end |
Instance Attribute Details
#blob_id ⇒ Object (readonly)
Returns the value of attribute blob_id.
8 9 10 |
# File 'lib/gitlab/git/raw_diff_change.rb', line 8 def blob_id @blob_id end |
#blob_size ⇒ Object (readonly)
Returns the value of attribute blob_size.
8 9 10 |
# File 'lib/gitlab/git/raw_diff_change.rb', line 8 def blob_size @blob_size end |
#new_path ⇒ Object (readonly)
Returns the value of attribute new_path.
8 9 10 |
# File 'lib/gitlab/git/raw_diff_change.rb', line 8 def new_path @new_path end |
#old_path ⇒ Object (readonly)
Returns the value of attribute old_path.
8 9 10 |
# File 'lib/gitlab/git/raw_diff_change.rb', line 8 def old_path @old_path end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
8 9 10 |
# File 'lib/gitlab/git/raw_diff_change.rb', line 8 def operation @operation end |