Class: Serega::SeregaValidations::Attribute::CheckOptSerializer
- Inherits:
-
Object
- Object
- Serega::SeregaValidations::Attribute::CheckOptSerializer
- Defined in:
- lib/serega/validations/attribute/check_opt_serializer.rb
Overview
Attribute :serializer
option validator
Class Method Summary collapse
-
.call(opts) ⇒ void
Checks attribute :serializer option.
Class Method Details
.call(opts) ⇒ void
This method returns an undefined value.
Checks attribute :serializer option
20 21 22 23 24 25 26 27 28 |
# File 'lib/serega/validations/attribute/check_opt_serializer.rb', line 20 def call(opts) return unless opts.key?(:serializer) value = opts[:serializer] return if valid_serializer?(value) raise SeregaError, "Invalid option :serializer => #{value.inspect}." \ " Can be a Serega subclass, a String or a Proc without arguments" end |