class Hscode::CliController
Public Class Methods
call(args)
click to toggle source
# File lib/hscode.rb, line 10 def self.call(args) options = Hscode::InputParser.new.parse(args) print_code(options) end
Private Class Methods
print_code(options)
click to toggle source
# File lib/hscode.rb, line 17 def self.print_code(options) status_code = HTTP_STATUS_CODES[options.status_code.to_i] unless status_code puts "#{options.status_code} is not a valid code. See 'hscode --help'." exit 1 end PrettyPrint.print( "#{options.status_code} - #{status_code[:title]}", options.status_code.to_s[0] ) print_description(status_code) if options.verbose end
print_description(status_code)
click to toggle source
# File lib/hscode.rb, line 32 def self.print_description(status_code) status_code[:description].each do |desc| PrettyPrint.print("\n#{desc}", '0') end end