Class: Git::DiffFileNumstatInfo Private
- Inherits:
-
Data
- Object
- Data
- Git::DiffFileNumstatInfo
- Defined in:
- lib/git/diff_file_numstat_info.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Immutable value object representing stats for a single file from git numstat output
Work in progress; this class is internal for now and may be made public in a future release.
Instance Attribute Summary collapse
-
#deletions ⇒ Integer
readonly
Number of lines deleted.
-
#insertions ⇒ Integer
readonly
Number of lines inserted.
-
#path ⇒ String
readonly
The file path (destination path for renames).
-
#src_path ⇒ String?
readonly
The source path for renamed files, nil otherwise.
Instance Method Summary collapse
-
#renamed? ⇒ Boolean
private
Check if this file was renamed.
Instance Attribute Details
#deletions ⇒ Integer (readonly)
Returns number of lines deleted.
22 23 24 25 26 27 28 29 30 |
# File 'lib/git/diff_file_numstat_info.rb', line 22 DiffFileNumstatInfo = Data.define(:path, :src_path, :insertions, :deletions) do # Check if this file was renamed # # @return [Boolean] true if the file was renamed # def renamed? !src_path.nil? end end |
#insertions ⇒ Integer (readonly)
Returns number of lines inserted.
22 23 24 25 26 27 28 29 30 |
# File 'lib/git/diff_file_numstat_info.rb', line 22 DiffFileNumstatInfo = Data.define(:path, :src_path, :insertions, :deletions) do # Check if this file was renamed # # @return [Boolean] true if the file was renamed # def renamed? !src_path.nil? end end |
#path ⇒ String (readonly)
Returns the file path (destination path for renames).
22 23 24 25 26 27 28 29 30 |
# File 'lib/git/diff_file_numstat_info.rb', line 22 DiffFileNumstatInfo = Data.define(:path, :src_path, :insertions, :deletions) do # Check if this file was renamed # # @return [Boolean] true if the file was renamed # def renamed? !src_path.nil? end end |
#src_path ⇒ String? (readonly)
Returns the source path for renamed files, nil otherwise.
22 23 24 25 26 27 28 29 30 |
# File 'lib/git/diff_file_numstat_info.rb', line 22 DiffFileNumstatInfo = Data.define(:path, :src_path, :insertions, :deletions) do # Check if this file was renamed # # @return [Boolean] true if the file was renamed # def renamed? !src_path.nil? end end |
Instance Method Details
#renamed? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Check if this file was renamed
27 28 29 |
# File 'lib/git/diff_file_numstat_info.rb', line 27 def renamed? !src_path.nil? end |