Class: Kiq::Display

Inherits:
Object
  • Object
show all
Defined in:
lib/kiq/helpers/display.rb

Overview

Displays help to the user

Class Method Summary collapse

Class Method Details

.command_help(command) ⇒ String

Returns the command help center

Parameters:

  • command (String)

Returns:

  • (String)


25
26
27
28
29
30
# File 'lib/kiq/helpers/display.rb', line 25

def self.command_help(command)
  puts 'NAME'
  puts Kiq::SPACES + Kiq::TITLE_HASH['NAME']
  puts 'SYNOPSIS'
  puts Kiq::SPACES + command + Kiq::SPACES + Kiq::COMMAND_HASH[command][1]
end

.helpString

Returns the full help center

Returns:

  • (String)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/kiq/helpers/display.rb', line 6

def self.help
  Kiq::TITLE_HASH.keys.each do |key|
    puts key
    puts Kiq::SPACES + Kiq::TITLE_HASH[key]
  end

  puts 'GLOBAL OPTIONS'
  puts Kiq::SPACES + Kiq::GLOBAL_COMMAND

  puts "COMMANDS"
  Kiq::COMMAND_HASH.keys.each do |key|
    puts Kiq::SPACES + key + Kiq::COMMAND_HASH[key][0]
  end
  puts "\n"
end