Class: Serega::SeregaPlugins::Formatters::CheckFormatter
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::Formatters::CheckFormatter
- Defined in:
- lib/serega/plugins/formatters/formatters.rb
Overview
Validator for formatters defined as config options or directly as attribute :format option
Class Method Summary collapse
-
.call(formatter_name, formatter) ⇒ void
Check formatter type and parameters.
Class Method Details
.call(formatter_name, formatter) ⇒ void
This method returns an undefined value.
Check formatter type and parameters
278 279 280 281 282 283 |
# File 'lib/serega/plugins/formatters/formatters.rb', line 278 def call(formatter_name, formatter) raise Serega::SeregaError, "Option #{formatter_name.inspect} must have callable value" unless formatter.respond_to?(:call) signature = SeregaUtils::MethodSignature.call(formatter, pos_limit: 2, keyword_args: [:ctx]) raise SeregaError, signature_error unless valid_signature?(signature) end |