Class: GitDB::Objects::Commit
- Inherits:
-
Base
- Object
- Base
- GitDB::Objects::Commit
show all
- Defined in:
- lib/git-db/objects/commit.rb
Instance Attribute Summary
Attributes inherited from Base
#data
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #inspect, #sha
Instance Method Details
#author ⇒ Object
3
4
5
|
# File 'lib/git-db/objects/commit.rb', line 3
def author
attributes['author'].first
end
|
#committer ⇒ Object
7
8
9
|
# File 'lib/git-db/objects/commit.rb', line 7
def committer
attributes['committer'].first
end
|
#message ⇒ Object
11
12
13
|
# File 'lib/git-db/objects/commit.rb', line 11
def message
data.split("\n\n", 2).last
end
|
#parents ⇒ Object
15
16
17
|
# File 'lib/git-db/objects/commit.rb', line 15
def parents
attributes['parent']
end
|
#properties ⇒ Object
19
20
21
|
# File 'lib/git-db/objects/commit.rb', line 19
def properties
[:tree, :parents, :author, :committer, :message]
end
|
#raw ⇒ Object
23
24
25
|
# File 'lib/git-db/objects/commit.rb', line 23
def raw
"commit #{data.length}\000#{data}"
end
|
#tree ⇒ Object
31
32
33
|
# File 'lib/git-db/objects/commit.rb', line 31
def tree
attributes['tree'].first
end
|
#type ⇒ Object
27
28
29
|
# File 'lib/git-db/objects/commit.rb', line 27
def type
GitDB::OBJ_COMMIT
end
|