Class: Ace::Hitl::Atoms::HitlEffectValidator
- Inherits:
-
Object
- Object
- Ace::Hitl::Atoms::HitlEffectValidator
- Defined in:
- lib/ace/hitl/atoms/hitl_effect_validator.rb
Overview
Client-side mirror of the Lab effect-declaration bounds so invalid requests fail fast, before any external call. Declarations are never rewritten or "fixed": values pass through verbatim or fail.
Defined Under Namespace
Classes: ValidationError
Constant Summary collapse
- MAX_MATCH_LENGTH =
200- MIN_ARGV_ELEMENTS =
1- MAX_ARGV_ELEMENTS =
16- MAX_ARG_LENGTH =
512- MIN_TIMEOUT =
1- MAX_TIMEOUT =
600
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(match:, effect_args:, effect_cwd:, effect_timeout:) ⇒ HitlEffectValidator
constructor
A new instance of HitlEffectValidator.
- #validate! ⇒ Object
Constructor Details
#initialize(match:, effect_args:, effect_cwd:, effect_timeout:) ⇒ HitlEffectValidator
Returns a new instance of HitlEffectValidator.
28 29 30 31 32 33 |
# File 'lib/ace/hitl/atoms/hitl_effect_validator.rb', line 28 def initialize(match:, effect_args:, effect_cwd:, effect_timeout:) @match = present?(match) ? match.to_s : nil @effect_args = Array(effect_args) @effect_cwd = present?(effect_cwd) ? effect_cwd.to_s : nil @effect_timeout = present?(effect_timeout) ? effect_timeout.to_s : nil end |
Class Method Details
.validate!(match: nil, effect_args: [], effect_cwd: nil, effect_timeout: nil) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/ace/hitl/atoms/hitl_effect_validator.rb', line 19 def self.validate!(match: nil, effect_args: [], effect_cwd: nil, effect_timeout: nil) new( match: match, effect_args: effect_args, effect_cwd: effect_cwd, effect_timeout: effect_timeout ).validate! end |
Instance Method Details
#validate! ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/ace/hitl/atoms/hitl_effect_validator.rb', line 35 def validate! validate_match validate_effect_args validate_effect_cwd validate_effect_timeout nil end |