Class: GitDag::CommitNode
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #add_parent(parent) ⇒ Object
- #dot_node ⇒ Object
- #id ⇒ Object
-
#initialize(grit_commit) ⇒ CommitNode
constructor
A new instance of CommitNode.
- #label ⇒ Object
Constructor Details
#initialize(grit_commit) ⇒ CommitNode
Returns a new instance of CommitNode.
3 4 5 6 |
# File 'lib/git-dag/commit_node.rb', line 3 def initialize(grit_commit) @grit_commit = grit_commit @parents = [] end |
Instance Method Details
#add_parent(parent) ⇒ Object
16 17 18 |
# File 'lib/git-dag/commit_node.rb', line 16 def add_parent(parent) @parents << parent end |
#dot_node ⇒ Object
20 21 22 |
# File 'lib/git-dag/commit_node.rb', line 20 def dot_node %Q("#{short_sha1}") end |
#id ⇒ Object
12 13 14 |
# File 'lib/git-dag/commit_node.rb', line 12 def id @grit_commit.id end |
#label ⇒ Object
8 9 10 |
# File 'lib/git-dag/commit_node.rb', line 8 def label %Q([color="#{color}"]) end |