Sha256: a218a152d8911dc946736523cef85e69369066b4a68c98c0ed211baebf551bff

Contents?: true

Size: 858 Bytes

Versions: 3

Compression:

Stored size: 858 Bytes

Contents

require_relative "../application"
require_relative "../formatter/concept_string_formatter"
require_relative "../logger"

module ConceptDisplayer
  ##
  # Show concepts on screen
  # @param concepts (Array) List of concept data
  def self.show(concepts)
    return if concepts.nil? || concepts.size.zero?

    show_mode = Application.instance.config["global"]["show_mode"]
    return unless show_mode

    msg = "\n[INFO] Showing concept data (#{Rainbow(show_mode).bright})"
    Logger.verboseln msg
    case show_mode
    when "resume"
      names = concepts.map { |c| c.name }
      s = " * Concepts (#{names.count}): #{names.join(",")}"
      Logger.verboseln s
    when "default"
      # Only show Concepts with process attr true
      concepts.each do |c|
        Logger.verboseln ConceptStringFormatter.to_s(c) if c.process?
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
asker-tool-2.7.2 lib/asker/displayer/concept_displayer.rb
asker-tool-2.7.1 lib/asker/displayer/concept_displayer.rb
asker-tool-2.7.0 lib/asker/displayer/concept_displayer.rb