Class: Amp::Core::Repositories::Git::CommitObject
- Defined in:
- lib/amp-git/repo_format/commit_object.rb
Overview
CommitObject
This is a commit object in the git system. This contains a reference to a tree, one or more parents, an author, a committer, and a message. This object is all you need to know everything about a commit.
Constant Summary
Constants inherited from RawObject
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#committer ⇒ Object
readonly
Returns the value of attribute committer.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#parent_refs ⇒ Object
readonly
Returns the value of attribute parent_refs.
-
#tree_ref ⇒ Object
readonly
Returns the value of attribute tree_ref.
Attributes inherited from RawObject
Instance Method Summary collapse
-
#initialize(hsh, opener, content = nil) ⇒ CommitObject
constructor
Initializes the CommitObject.
Methods inherited from RawObject
Constructor Details
#initialize(hsh, opener, content = nil) ⇒ CommitObject
Initializes the CommitObject. Needs a hash to identify it and an opener. The opener should point to the .git directory. Immediately parses the object.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/amp-git/repo_format/commit_object.rb', line 44 def initialize(hsh, opener, content = nil) if content @hash_id, @opener = hsh, opener @type = 'commit' @content = content else super(hsh, opener) end @parent_refs = [] parse! end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
32 33 34 |
# File 'lib/amp-git/repo_format/commit_object.rb', line 32 def @author end |
#committer ⇒ Object (readonly)
Returns the value of attribute committer.
32 33 34 |
# File 'lib/amp-git/repo_format/commit_object.rb', line 32 def committer @committer end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
32 33 34 |
# File 'lib/amp-git/repo_format/commit_object.rb', line 32 def date @date end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
32 33 34 |
# File 'lib/amp-git/repo_format/commit_object.rb', line 32 def @message end |
#parent_refs ⇒ Object (readonly)
Returns the value of attribute parent_refs.
32 33 34 |
# File 'lib/amp-git/repo_format/commit_object.rb', line 32 def parent_refs @parent_refs end |
#tree_ref ⇒ Object (readonly)
Returns the value of attribute tree_ref.
32 33 34 |
# File 'lib/amp-git/repo_format/commit_object.rb', line 32 def tree_ref @tree_ref end |