lib/serega/validations/initiate/check_modifiers.rb in serega-0.6.1 vs lib/serega/validations/initiate/check_modifiers.rb in serega-0.7.0
- old
+ new
@@ -1,11 +1,26 @@
# frozen_string_literal: true
class Serega
module SeregaValidations
+ #
+ # Validations that take place when initializing serializer
+ #
module Initiate
+ #
+ # Modifiers validation
+ #
class CheckModifiers
class << self
+ # Validates provided fields names are existing attributes
+ #
+ # @param serializer_class [Serega]
+ # @param fields [Hash] validated fields
+ #
+ # @raise [Serega::AttributeNotExist] when modifier not exist as attribute
+ #
+ # @return [void]
+ #
def call(serializer_class, fields)
return unless fields
validate(serializer_class, fields, [])
end