Class: Backlog::Help

Inherits:
Object
  • Object
show all
Defined in:
lib/backlog/help.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cli_args, *args) ⇒ Help

Returns a new instance of Help.



4
5
6
# File 'lib/backlog/help.rb', line 4

def initialize(cli_args, *args)

end

Class Method Details

.helpObject



21
22
23
24
25
26
27
# File 'lib/backlog/help.rb', line 21

def self.help()

  return <<-eos
  Help: Print this menu
  eos

end

Instance Method Details

#execute!Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/backlog/help.rb', line 8

def execute!

  menu = "Version: #{VERSION}" 
  puts "#{menu}\n#{(0..menu.length).map{"-"}.join}"

  # run the command as needed
  CLI.commands.each do |command, command_class| 
    
    print_help command_class

  end
end


29
30
31
32
33
34
35
36
37
# File 'lib/backlog/help.rb', line 29

def print_help(command_class)

  if defined? command_class.help

    help = command_class.help
    puts help
  end

end