Class: Git::DiffFileNumstatInfo

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#deletionsObject (readonly)

Returns the value of attribute deletions

Returns:

  • (Object)

    the current value of deletions



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

#insertionsObject (readonly)

Returns the value of attribute insertions

Returns:

  • (Object)

    the current value of insertions



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

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



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_pathObject (readonly)

Returns the value of attribute src_path

Returns:

  • (Object)

    the current value of src_path



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

Returns:

  • (Boolean)

    true if the file was renamed



25
26
27
# File 'lib/git/diff_file_numstat_info.rb', line 25

def renamed?
  !src_path.nil?
end