Class: Render::ParseWarningsSection
- Inherits:
-
Object
- Object
- Render::ParseWarningsSection
- Defined in:
- action/lib/render/parse_warnings_section.rb
Overview
Unified rendering for manifest parse warnings in summaries and comments.
Instance Method Summary collapse
- #comment_markdown ⇒ Object
-
#initialize(parse_warnings) ⇒ ParseWarningsSection
constructor
A new instance of ParseWarningsSection.
- #summary_lines ⇒ Object
Constructor Details
#initialize(parse_warnings) ⇒ ParseWarningsSection
Returns a new instance of ParseWarningsSection.
28 29 30 |
# File 'action/lib/render/parse_warnings_section.rb', line 28 def initialize(parse_warnings) @parse_warnings = Array(parse_warnings) end |
Instance Method Details
#comment_markdown ⇒ Object
38 39 40 41 42 |
# File 'action/lib/render/parse_warnings_section.rb', line 38 def comment_markdown return nil if @parse_warnings.empty? [header, "", *@parse_warnings.map { |record| Bullet.new(record).markdown }].join("\n") end |
#summary_lines ⇒ Object
32 33 34 35 36 |
# File 'action/lib/render/parse_warnings_section.rb', line 32 def summary_lines return [] if @parse_warnings.empty? ["", "### Parse warnings", "", *@parse_warnings.map { |record| Bullet.new(record).markdown }] end |