Class: StackMaster::ParameterValidator
- Inherits:
-
Object
- Object
- StackMaster::ParameterValidator
- Defined in:
- lib/stack_master/parameter_validator.rb
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(stack:, stack_definition:) ⇒ ParameterValidator
constructor
A new instance of ParameterValidator.
- #missing_parameters? ⇒ Boolean
Constructor Details
#initialize(stack:, stack_definition:) ⇒ ParameterValidator
Returns a new instance of ParameterValidator.
5 6 7 8 |
# File 'lib/stack_master/parameter_validator.rb', line 5 def initialize(stack:, stack_definition:) @stack = stack @stack_definition = stack_definition end |
Instance Method Details
#error_message ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/stack_master/parameter_validator.rb', line 10 def return nil unless missing_parameters? = "Empty/blank parameters detected. Please provide values for these parameters:\n" missing_parameters.each do |parameter_name| << " - #{parameter_name}\n" end if @stack_definition.parameter_files.empty? << else << end end |
#missing_parameters? ⇒ Boolean
24 25 26 |
# File 'lib/stack_master/parameter_validator.rb', line 24 def missing_parameters? missing_parameters.any? end |