Class: CommitMessage
- Inherits:
-
Object
- Object
- CommitMessage
- Defined in:
- lib/commit_message.rb
Instance Attribute Summary collapse
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#pair ⇒ Object
readonly
Returns the value of attribute pair.
Instance Method Summary collapse
-
#initialize(prompt_exclusions = []) ⇒ CommitMessage
constructor
A new instance of CommitMessage.
- #joined_message ⇒ Object
Constructor Details
#initialize(prompt_exclusions = []) ⇒ CommitMessage
Returns a new instance of CommitMessage.
5 6 7 8 9 |
# File 'lib/commit_message.rb', line 5 def initialize(prompt_exclusions = []) @pair = PromptLine.new("pair", prompt_exclusions).prompt @feature = PromptLine.new("feature", prompt_exclusions).prompt @message = PromptLine.new("message", prompt_exclusions).prompt end |
Instance Attribute Details
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
3 4 5 |
# File 'lib/commit_message.rb', line 3 def feature @feature end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/commit_message.rb', line 3 def @message end |
#pair ⇒ Object (readonly)
Returns the value of attribute pair.
3 4 5 |
# File 'lib/commit_message.rb', line 3 def pair @pair end |
Instance Method Details
#joined_message ⇒ Object
11 12 13 |
# File 'lib/commit_message.rb', line 11 def [@pair, @feature, @message].compact.join(' - ') end |