Class: Serega::SeregaPlugins::Formatters::CheckOptFormat
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::Formatters::CheckOptFormat
- Defined in:
- lib/serega/plugins/formatters/formatters.rb
Overview
Validator for attribute :format option
Class Method Summary collapse
-
.call(opts, serializer_class) ⇒ void
Checks attribute :format option must be registered or valid callable with maximum 2 args.
Class Method Details
.call(opts, serializer_class) ⇒ void
This method returns an undefined value.
Checks attribute :format option must be registered or valid callable with maximum 2 args
243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/serega/plugins/formatters/formatters.rb', line 243 def call(opts, serializer_class) return unless opts.key?(:format) formatter = opts[:format] if formatter.is_a?(Symbol) check_formatter_defined(serializer_class, formatter) else CheckFormatter.call(:format, formatter) end end |