Class: HammerCLIForeman::OptionSources::FieldsParams

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

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ FieldsParams

Returns a new instance of FieldsParams.



4
5
6
# File 'lib/hammer_cli_foreman/option_sources/fields_params.rb', line 4

def initialize(command)
  @command = command
end

Instance Method Details

#get_options(_defined_options, result) ⇒ Object



12
13
14
15
16
17
# File 'lib/hammer_cli_foreman/option_sources/fields_params.rb', line 12

def get_options(_defined_options, result)
  if @command.respond_to?(:option_fields) && @command.option_fields == ['THIN']
    result[HammerCLI.option_accessor_name('thin')] = true
  end
  result
end

#process(defined_options, result) ⇒ Object



8
9
10
# File 'lib/hammer_cli_foreman/option_sources/fields_params.rb', line 8

def process(defined_options, result)
  get_options(defined_options, result)
end