Class: Moonshot::AlwaysUseDefaultSource

Inherits:
Object
  • Object
show all
Defined in:
lib/moonshot/always_use_default_source.rb

Overview

The AlwaysUseDefaultSource will always use the previous value in the stack, or use the default value during stack creation. This is useful if plugins provide the value for a parameter, and we don’t want to prompt the user for an override. Of course, overrides from answer files or command-line arguments will always apply.

Instance Method Summary collapse

Instance Method Details

#get(sp) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/moonshot/always_use_default_source.rb', line 10

def get(sp)
  # Don't do anything, the default will apply on create, and the
  # previous value will be used on update.
  return if sp.default?

  raise "Parameter #{sp.name} does not have a default, cannot use AlwaysUseDefaultSource!"
end