Class: HammerCLI::Options::Sources::SavedDefaults

Inherits:
Base show all
Defined in:
lib/hammer_cli/options/sources/saved_defaults.rb

Instance Method Summary collapse

Methods inherited from Base

#process

Methods inherited from OptionProcessor

#name, #process

Constructor Details

#initialize(defaults, logger) ⇒ SavedDefaults

Returns a new instance of SavedDefaults.



7
8
9
10
# File 'lib/hammer_cli/options/sources/saved_defaults.rb', line 7

def initialize(defaults, logger)
  @defaults = defaults
  @logger = logger
end

Instance Method Details

#get_options(defined_options, result) ⇒ Object



12
13
14
15
16
17
# File 'lib/hammer_cli/options/sources/saved_defaults.rb', line 12

def get_options(defined_options, result)
  defined_options.each do |opt|
    result[opt.attribute_name] = add_custom_defaults(opt) if result[opt.attribute_name].nil?
  end if @defaults
  result
end