Module: HammerCLIForemanPuppet::AssociatingCommands::ExtendCommands

Defined in:
lib/hammer_cli_foreman_puppet/associating_commands/associating_commands.rb

Instance Method Summary collapse

Instance Method Details

#create_subcommand(name = :PuppetEnvironment) ⇒ Object



4
5
6
7
8
9
# File 'lib/hammer_cli_foreman_puppet/associating_commands/associating_commands.rb', line 4

def create_subcommand(name = :PuppetEnvironment)
  commands = constants.select { |c| c.to_s.include? name.to_s }.map { |p| const_get(p)}
  commands.each do |command|
    subcommand(command.command_name, command.desc, command, warning: command.warning)
  end
end