Class: Aws::Templates::Utils::Parametrized::Constraint::AllOf
- Inherits:
-
Aws::Templates::Utils::Parametrized::Constraint
- Object
- Aws::Templates::Utils::Parametrized::Constraint
- Aws::Templates::Utils::Parametrized::Constraint::AllOf
- Defined in:
- lib/aws/templates/utils/parametrized/constraints.rb
Overview
Aggregate constraint
It is used to perform checks against a list of constraints-functors or lambdas.
Example
class Piece
include Aws::Templates::Utils::Parametrized
parameter :param1,
:constraint => all_of(
not_nil,
satisfies("Should be moderate") { |v| v < 100 }
)
end
i = Piece.new(:param1 => nil)
i.param1 # raise ParameterValueInvalid
i = Piece.new(:param1 => 200)
i.param1 # raise ParameterValueInvalid with description
i = Piece.new(:param1 => 50)
i.param1 # => 50
Instance Attribute Summary collapse
-
#constraints ⇒ Object
readonly
Returns the value of attribute constraints.
Instance Method Summary collapse
-
#initialize(constraints) ⇒ AllOf
constructor
A new instance of AllOf.
Methods inherited from Aws::Templates::Utils::Parametrized::Constraint
Constructor Details
#initialize(constraints) ⇒ AllOf
Returns a new instance of AllOf.
296 297 298 |
# File 'lib/aws/templates/utils/parametrized/constraints.rb', line 296 def initialize(constraints) @constraints = constraints end |
Instance Attribute Details
#constraints ⇒ Object (readonly)
Returns the value of attribute constraints.
294 295 296 |
# File 'lib/aws/templates/utils/parametrized/constraints.rb', line 294 def constraints @constraints end |