Class: Watson::Printer
Overview
Printer class that handles all formatting and printing of parsed dir/file structure
Constant Summary
Constants included from Watson
BLUE, BOLD, CYAN, GRAY, GREEN, MAGENTA, RED, RESET, UNDERLINE, VERSION, WHITE, YELLOW
Instance Method Summary collapse
- #build_formatter ⇒ Object
-
#initialize(config) ⇒ Printer
constructor
Printer initialization method to setup necessary parameters, states, and vars.
-
#run(structure) ⇒ Object
Take parsed structure and print out in specified formatting.
Methods included from Watson
Constructor Details
#initialize(config) ⇒ Printer
Printer initialization method to setup necessary parameters, states, and vars
30 31 32 33 34 |
# File 'lib/watson/printer.rb', line 30 def initialize(config) # Identify method entry debug_print "#{self} : #{__method__}\n" @config = config end |
Instance Method Details
#build_formatter ⇒ Object
45 46 47 |
# File 'lib/watson/printer.rb', line 45 def build_formatter @formatter ||= @config.output_format.new(@config) end |
#run(structure) ⇒ Object
Take parsed structure and print out in specified formatting
38 39 40 41 42 43 |
# File 'lib/watson/printer.rb', line 38 def run(structure) # Identify method entry debug_print "#{self} : #{__method__}\n" build_formatter.run(structure) end |