Class: ReleaseNotes::Section

Inherits:
Object
  • Object
show all
Defined in:
action/lib/release_notes.rb

Overview

Renders fetched release notes as collapsed Markdown details blocks.

Instance Method Summary collapse

Constructor Details

#initialize(details, fetcher) ⇒ Section

Returns a new instance of Section.



194
195
196
197
# File 'action/lib/release_notes.rb', line 194

def initialize(details, fetcher)
  @details = Array(details)
  @fetcher = fetcher
end

Instance Method Details

#markdownObject



199
200
201
202
# File 'action/lib/release_notes.rb', line 199

def markdown
  sections = @details.filter_map { |detail| Block.new(detail, @fetcher).markdown }
  sections.join("\n\n") unless sections.empty?
end