Class: Castkit::Validators::CollectionValidator
- Defined in:
- lib/castkit/validators/collection_validator.rb
Overview
Validator for array (collection) attributes.
Ensures that the provided value is an instance of Array. This validator is typically used by Castkit::Types::Collection for attributes defined as arrays.
Instance Method Summary collapse
-
#call(value, options:, context:) ⇒ void
Validates that the value is an Array.
Methods inherited from Base
Instance Method Details
#call(value, options:, context:) ⇒ void
This method returns an undefined value.
Validates that the value is an Array.
24 25 26 |
# File 'lib/castkit/validators/collection_validator.rb', line 24 def call(value, options:, context:) # rubocop:disable Lint/UnusedMethodArgument type_error!(:array, value, context: context) unless value.is_a?(::Array) end |