Module: ConceptDisplayer

Defined in:
lib/asker/displayer/concept_displayer.rb

Overview

Show Concept Data on screen

Class Method Summary collapse

Class Method Details

.show(concepts) ⇒ Object

Show concepts on screen

Parameters:

  • concepts (Array)


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 11

def self.show(concepts)
  show_mode = Application.instance.config['global']['show_mode']
  return unless show_mode

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