Class: Git::FsckObject
- Inherits:
-
Object
- Object
- Git::FsckObject
- Defined in:
- lib/git/fsck_object.rb
Overview
Represents an object returned by git fsck
This class provides information about dangling, missing, unreachable, or problematic Git objects found during repository integrity checks.
Instance Attribute Summary collapse
-
#message ⇒ String?
readonly
A warning or error message associated with this object.
-
#name ⇒ String?
readonly
A name describing how the object is reachable (from --name-objects).
-
#sha ⇒ String
readonly
The SHA-1 hash of the object.
-
#type ⇒ Symbol
readonly
The type of the Git object.
Instance Method Summary collapse
-
#initialize(type:, sha:, message: nil, name: nil) ⇒ FsckObject
constructor
Create a new FsckObject.
-
#to_s ⇒ String
Returns the SHA as the string representation.
Constructor Details
#initialize(type:, sha:, message: nil, name: nil) ⇒ FsckObject
Create a new FsckObject
35 36 37 38 39 40 |
# File 'lib/git/fsck_object.rb', line 35 def initialize(type:, sha:, message: nil, name: nil) @type = type @sha = sha @message = @name = name end |
Instance Attribute Details
#message ⇒ String? (readonly)
A warning or error message associated with this object
22 23 24 |
# File 'lib/git/fsck_object.rb', line 22 def @message end |
#name ⇒ String? (readonly)
A name describing how the object is reachable (from --name-objects)
26 27 28 |
# File 'lib/git/fsck_object.rb', line 26 def name @name end |
#sha ⇒ String (readonly)
The SHA-1 hash of the object
18 19 20 |
# File 'lib/git/fsck_object.rb', line 18 def sha @sha end |
#type ⇒ Symbol (readonly)
The type of the Git object
14 15 16 |
# File 'lib/git/fsck_object.rb', line 14 def type @type end |
Instance Method Details
#to_s ⇒ String
Returns the SHA as the string representation
44 45 46 |
# File 'lib/git/fsck_object.rb', line 44 def to_s sha end |