module ErrandBoy module Validator def self.build(request) class_name = request.provider.capitalize class_name += request.action.capitalize const_get(class_name).new(request) rescue NameError raise InvalidError, "#{request.provider} #{request.action} does not defined." end end end