Class: HammerCLIForemanPuppet::OptionSources::PuppetEnvironmentParams

Inherits:
HammerCLI::Options::Sources::Base
  • Object
show all
Defined in:
lib/hammer_cli_foreman_puppet/option_sources/puppet_environment_params.rb

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ PuppetEnvironmentParams

Returns a new instance of PuppetEnvironmentParams.



5
6
7
# File 'lib/hammer_cli_foreman_puppet/option_sources/puppet_environment_params.rb', line 5

def initialize(command)
  @command = command
end

Instance Method Details

#get_options(_defined_options, result) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/hammer_cli_foreman_puppet/option_sources/puppet_environment_params.rb', line 9

def get_options(_defined_options, result)
  if result['option_environment_id'].nil? &&
     (@command.respond_to?(:option_environment_id) ||
     @command.respond_to?(:option_environment_name))
    put_puppet_environment_id(result)
  end
  if result['option_environment_ids'].nil? &&
     (@command.respond_to?(:option_environment_ids) ||
     @command.respond_to?(:option_environment_names))
    put_puppet_environment_ids(result)
  end
  result
end