Module: Hasmenu::Printer
- Included in:
- Builder, Formatter, Reporter, SpellChecker, Validator
- Defined in:
- lib/hasmenu/printer.rb
Instance Method Summary collapse
- #print_build_for(restaurant) ⇒ Object
- #print_build_start ⇒ Object
- #print_format_for(file) ⇒ Object
- #print_format_start ⇒ Object
- #print_header(title) ⇒ Object
- #print_invalid_build ⇒ Object
- #print_invalid_format ⇒ Object
- #print_invalid_path ⇒ Object
- #print_invalid_report ⇒ Object
- #print_invalid_sequence ⇒ Object
- #print_invalid_version ⇒ Object
- #print_report(data) ⇒ Object
- #print_warn_repeats ⇒ Object
Instance Method Details
#print_build_for(restaurant) ⇒ Object
47 48 49 |
# File 'lib/hasmenu/printer.rb', line 47 def print_build_for(restaurant) puts " - #{restaurant}".colorize(:green) end |
#print_build_start ⇒ Object
43 44 45 |
# File 'lib/hasmenu/printer.rb', line 43 def print_build_start puts "building restaurant menus".colorize(:green) end |
#print_format_for(file) ⇒ Object
23 24 25 |
# File 'lib/hasmenu/printer.rb', line 23 def print_format_for(file) puts " - #{file}".colorize(:green) end |
#print_format_start ⇒ Object
19 20 21 |
# File 'lib/hasmenu/printer.rb', line 19 def print_format_start puts "formatting files".colorize(:green) end |
#print_header(title) ⇒ Object
5 6 7 8 9 |
# File 'lib/hasmenu/printer.rb', line 5 def print_header(title) puts "--------------------------------------------------------------------------------".colorize(:green) puts title.colorize(:green) puts "--------------------------------------------------------------------------------".colorize(:green) end |
#print_invalid_build ⇒ Object
39 40 41 |
# File 'lib/hasmenu/printer.rb', line 39 def print_invalid_build puts "\n error: please provide a valid build type\n".colorize(:red) end |
#print_invalid_format ⇒ Object
15 16 17 |
# File 'lib/hasmenu/printer.rb', line 15 def print_invalid_format puts "\n error: please provide a valid format type\n".colorize(:red) end |
#print_invalid_path ⇒ Object
11 12 13 |
# File 'lib/hasmenu/printer.rb', line 11 def print_invalid_path puts "\n error: please provide a valid file or directory\n".colorize(:red) end |
#print_invalid_report ⇒ Object
51 52 53 |
# File 'lib/hasmenu/printer.rb', line 51 def print_invalid_report puts "\n error: please provide a valid report type\n".colorize(:red) end |
#print_invalid_sequence ⇒ Object
31 32 33 |
# File 'lib/hasmenu/printer.rb', line 31 def print_invalid_sequence puts "#: failed name #: filename sequence should be a number for active, and xa for inactive menu" end |
#print_invalid_version ⇒ Object
35 36 37 |
# File 'lib/hasmenu/printer.rb', line 35 def print_invalid_version puts "#: failed name #: filename should match with menu uid and version" end |
#print_report(data) ⇒ Object
55 56 57 58 |
# File 'lib/hasmenu/printer.rb', line 55 def print_report(data) data.each { |d| puts " - #{d}".colorize(:green) } print_header "Count: #{data.count}" end |
#print_warn_repeats ⇒ Object
27 28 29 |
# File 'lib/hasmenu/printer.rb', line 27 def print_warn_repeats puts "warning: please review the use of repeat property".colorize(:yellow) end |