class SciolyFF::Validator::Checker

An empty base class to ensure consistent inheritance. All instance methods in children classes should take the arguments rep and logger.

Public Class Methods

inherited(subclass) click to toggle source
# File lib/sciolyff/validator/checker.rb, line 18
def self.inherited(subclass)
  subclass.prepend SafeInitialize
end
new(rep) click to toggle source
# File lib/sciolyff/validator/checker.rb, line 7
def initialize(rep); end

Public Instance Methods

send(method, *args) click to toggle source

wraps method calls (always using send in Validator) so that exceptions in the check cause check to pass, as what caused the exception should cause some other check to fail if the SciolyFF is truly invalid

this simplifies the checking code greatly, even if it is a bit hacky

Calls superclass method
# File lib/sciolyff/validator/checker.rb, line 27
def send(method, *args)
  super
rescue StandardError => e
  args[1].debug "#{e}\n  #{e.backtrace.first}" # args[1] is the logger
end