Class: HammerCLIForeman::OptionSources::SelfParam
- Inherits:
-
HammerCLI::Options::Sources::Base
- Object
- HammerCLI::Options::Sources::Base
- HammerCLIForeman::OptionSources::SelfParam
- Defined in:
- lib/hammer_cli_foreman/option_sources/self_param.rb
Instance Method Summary collapse
- #get_options(defined_options, result) ⇒ Object
-
#initialize(command) ⇒ SelfParam
constructor
A new instance of SelfParam.
Constructor Details
#initialize(command) ⇒ SelfParam
Returns a new instance of SelfParam.
4 5 6 |
# File 'lib/hammer_cli_foreman/option_sources/self_param.rb', line 4 def initialize(command) @command = command end |
Instance Method Details
#get_options(defined_options, result) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/hammer_cli_foreman/option_sources/self_param.rb', line 8 def (, result) # resolve 'id' parameter if it's defined as an option id_option_name = HammerCLI.option_accessor_name('id') result[id_option_name] ||= @command.get_identifier(result) if @command.respond_to?(id_option_name) result end |