Class: CommitFormat::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/commit_format/formatter.rb

Defined Under Namespace

Classes: Message

Instance Method Summary collapse

Constructor Details

#initialize(commits, options = {}) ⇒ Formatter

Returns a new instance of Formatter.



5
6
7
8
# File 'lib/commit_format/formatter.rb', line 5

def initialize(commits, options = {})
  @commits = commits
  @paragraph = options[:paragraph]
end

Instance Method Details

#formatted_commitsObject



10
11
12
13
14
15
16
17
18
# File 'lib/commit_format/formatter.rb', line 10

def formatted_commits
  @commits.map do |commit|
    if @paragraph
      format_commit_as_paragraphs(commit)
    else
      format_commit(commit)
    end
  end
end