Class: GFSM::Data::Commit
- Inherits:
-
Object
- Object
- GFSM::Data::Commit
- Extended by:
- Forwardable
- Defined in:
- lib/data/commit.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#trailer_key ⇒ Object
readonly
Returns the value of attribute trailer_key.
Instance Method Summary collapse
-
#initialize(commit, trailer_key, category) ⇒ Commit
constructor
A new instance of Commit.
- #short_sha(length = 7) ⇒ Object
- #to_changelog_entry ⇒ Object
Constructor Details
#initialize(commit, trailer_key, category) ⇒ Commit
Returns a new instance of Commit.
12 13 14 15 16 17 |
# File 'lib/data/commit.rb', line 12 def initialize(commit, trailer_key, category) @commit = commit @trailer_key = trailer_key @category = category @subject = commit..lines.first.chomp end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
10 11 12 |
# File 'lib/data/commit.rb', line 10 def category @category end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
10 11 12 |
# File 'lib/data/commit.rb', line 10 def subject @subject end |
#trailer_key ⇒ Object (readonly)
Returns the value of attribute trailer_key.
10 11 12 |
# File 'lib/data/commit.rb', line 10 def trailer_key @trailer_key end |
Instance Method Details
#short_sha(length = 7) ⇒ Object
19 20 21 |
# File 'lib/data/commit.rb', line 19 def short_sha(length = 7) self.sha[0, length] end |
#to_changelog_entry ⇒ Object
23 24 25 |
# File 'lib/data/commit.rb', line 23 def to_changelog_entry "#{subject} (#{short_sha})" end |