Method: Sfn::Utils::StackParameterValidator#max_value

Defined in:
lib/sfn/utils/stack_parameter_validator.rb

#max_value(value, pdef) ⇒ TrueClass, String

Parameter value is less than or equal to max value

Parameters:

  • value (String)
  • pdef (Hash)

    parameter definition

Options Hash (pdef):

  • 'MaxValue' (String)

Returns:

  • (TrueClass, String)


157
158
159
160
161
162
163
# File 'lib/sfn/utils/stack_parameter_validator.rb', line 157

def max_value(value, pdef)
  if value.to_i <= pdef.to_i
    true
  else
    "Value must not be greater than #{pdef}"
  end
end