class Krane::DeferredSummaryLogging::DeferredSummary

Attributes

paragraphs[R]

Public Class Methods

new() click to toggle source
# File lib/krane/deferred_summary_logging.rb, line 67
def initialize
  @actions_taken = []
  @paragraphs = []
end

Public Instance Methods

actions_sentence() click to toggle source
# File lib/krane/deferred_summary_logging.rb, line 72
def actions_sentence
  return unless @actions_taken.present?
  @actions_taken.to_sentence.capitalize
end
add_action(sentence_fragment) click to toggle source

Saves a sentence fragment to be displayed in the first sentence of the summary section

Example: # The resulting summary will begin with “Created 3 secrets and failed to deploy 2 resources” @logger.summary.add_action(“created 3 secrets”) @logger.summary.add_action(“failed to deploy 2 resources”)

# File lib/krane/deferred_summary_logging.rb, line 83
def add_action(sentence_fragment)
  @actions_taken << sentence_fragment
end
add_paragraph(paragraph) click to toggle source

Adds a paragraph to be displayed in the summary section Paragraphs will be printed in the order they were added, separated by a blank line This can be used to log a block of data on a particular topic, e.g. debug info for a particular failed resource

# File lib/krane/deferred_summary_logging.rb, line 90
def add_paragraph(paragraph)
  paragraphs << paragraph
end