Class: ConceptDisplayer

Inherits:
Object
  • Object
show all
Defined in:
lib/asker/displayer/concept_displayer.rb

Instance Method Summary collapse

Instance Method Details

#call(concepts) ⇒ Object

Show concepts on screen

Parameters:

  • concepts (Array)

    List of concept data



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/asker/displayer/concept_displayer.rb', line 9

def call(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