Class: Git::DiffFileNumstatInfo
- Inherits:
-
Data
- Object
- Data
- Git::DiffFileNumstatInfo
- Defined in:
- lib/git/diff_file_numstat_info.rb
Overview
Immutable value object representing stats for a single file from git numstat output
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
Check if this file was renamed.
Instance Attribute Details
#deletions ⇒ Integer (readonly)
Returns number of lines deleted.
20 21 22 23 24 25 26 27 28 |
# File 'lib/git/diff_file_numstat_info.rb', line 20 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.
20 21 22 23 24 25 26 27 28 |
# File 'lib/git/diff_file_numstat_info.rb', line 20 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).
20 21 22 23 24 25 26 27 28 |
# File 'lib/git/diff_file_numstat_info.rb', line 20 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.
20 21 22 23 24 25 26 27 28 |
# File 'lib/git/diff_file_numstat_info.rb', line 20 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
Check if this file was renamed
25 26 27 |
# File 'lib/git/diff_file_numstat_info.rb', line 25 def renamed? !src_path.nil? end |