Class: RakeCommit::CommitMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/rake_commit/commit_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prompt_exclusions = []) ⇒ CommitMessage

Returns a new instance of CommitMessage.



6
7
8
9
10
# File 'lib/rake_commit/commit_message.rb', line 6

def initialize(prompt_exclusions = [])
  @author = RakeCommit::PromptLine.new("author", prompt_exclusions).prompt
  @feature = RakeCommit::PromptLine.new("feature", prompt_exclusions).prompt
  @message = RakeCommit::PromptLine.new("message", prompt_exclusions).prompt
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



4
5
6
# File 'lib/rake_commit/commit_message.rb', line 4

def author
  @author
end

#featureObject (readonly)

Returns the value of attribute feature.



4
5
6
# File 'lib/rake_commit/commit_message.rb', line 4

def feature
  @feature
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/rake_commit/commit_message.rb', line 4

def message
  @message
end

Instance Method Details

#joined_messageObject



12
13
14
# File 'lib/rake_commit/commit_message.rb', line 12

def joined_message
  [@author, @feature, @message].compact.join(' - ')
end