Class: RuboBot::Git::CommitMessage
- Inherits:
-
Object
- Object
- RuboBot::Git::CommitMessage
- Defined in:
- lib/rubobot/git/commit_message.rb
Overview
A Git commit message
Instance Method Summary collapse
- #==(other) ⇒ Object
- #body ⇒ Object
-
#initialize(cop, command, stdout) ⇒ CommitMessage
constructor
A new instance of CommitMessage.
- #subject ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(cop, command, stdout) ⇒ CommitMessage
Returns a new instance of CommitMessage.
7 8 9 10 11 |
# File 'lib/rubobot/git/commit_message.rb', line 7 def initialize(cop, command, stdout) @cop = cop @command = command @stdout = stdout end |
Instance Method Details
#==(other) ⇒ Object
33 34 35 |
# File 'lib/rubobot/git/commit_message.rb', line 33 def ==(other) to_h == other.to_h end |
#body ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/rubobot/git/commit_message.rb', line 17 def body <<~MSG #{command} #{stdout} MSG end |
#subject ⇒ Object
13 14 15 |
# File 'lib/rubobot/git/commit_message.rb', line 13 def subject "Auto-correct #{cop}" end |
#to_s ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/rubobot/git/commit_message.rb', line 25 def to_s <<~MSG.chomp #{subject} #{body} MSG end |