Class: Git::FileDiffInfo
- Inherits:
-
Data
- Object
- Data
- Git::FileDiffInfo
- Defined in:
- lib/git/diff_info.rb
Overview
Immutable value object representing a single file's diff information
FileDiffInfo encapsulates the parsed data from a unified diff for one file, including the file path, patch text, mode changes, object identifiers, and type.
This class is used by DiffInfo for the legacy diff API.
Instance Attribute Summary collapse
-
#binary ⇒ Object
readonly
Returns the value of attribute binary.
-
#dst ⇒ Object
readonly
Returns the value of attribute dst.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#patch ⇒ Object
readonly
Returns the value of attribute patch.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#src ⇒ Object
readonly
Returns the value of attribute src.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#binary? ⇒ Boolean
Check if this is a binary file.
Instance Attribute Details
#binary ⇒ Object (readonly)
Returns the value of attribute binary
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/git/diff_info.rb', line 45 FileDiffInfo = Data.define( :path, :patch, :mode, :src, :dst, :type, :binary ) do # Check if this is a binary file # # @return [Boolean] true if the file is binary # def binary? binary end end |
#dst ⇒ Object (readonly)
Returns the value of attribute dst
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/git/diff_info.rb', line 45 FileDiffInfo = Data.define( :path, :patch, :mode, :src, :dst, :type, :binary ) do # Check if this is a binary file # # @return [Boolean] true if the file is binary # def binary? binary end end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/git/diff_info.rb', line 45 FileDiffInfo = Data.define( :path, :patch, :mode, :src, :dst, :type, :binary ) do # Check if this is a binary file # # @return [Boolean] true if the file is binary # def binary? binary end end |
#patch ⇒ Object (readonly)
Returns the value of attribute patch
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/git/diff_info.rb', line 45 FileDiffInfo = Data.define( :path, :patch, :mode, :src, :dst, :type, :binary ) do # Check if this is a binary file # # @return [Boolean] true if the file is binary # def binary? binary end end |
#path ⇒ Object (readonly)
Returns the value of attribute path
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/git/diff_info.rb', line 45 FileDiffInfo = Data.define( :path, :patch, :mode, :src, :dst, :type, :binary ) do # Check if this is a binary file # # @return [Boolean] true if the file is binary # def binary? binary end end |
#src ⇒ Object (readonly)
Returns the value of attribute src
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/git/diff_info.rb', line 45 FileDiffInfo = Data.define( :path, :patch, :mode, :src, :dst, :type, :binary ) do # Check if this is a binary file # # @return [Boolean] true if the file is binary # def binary? binary end end |
#type ⇒ Object (readonly)
Returns the value of attribute type
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/git/diff_info.rb', line 45 FileDiffInfo = Data.define( :path, :patch, :mode, :src, :dst, :type, :binary ) do # Check if this is a binary file # # @return [Boolean] true if the file is binary # def binary? binary end end |
Instance Method Details
#binary? ⇒ Boolean
Check if this is a binary file
58 59 60 |
# File 'lib/git/diff_info.rb', line 58 def binary? binary end |