Sha256: 036d9d024b738e572ce7757c13b7715f8fb511f89cee4d8ede7f9532f4b018d4
Contents?: true
Size: 896 Bytes
Versions: 46
Compression:
Stored size: 896 Bytes
Contents
# encoding: utf-8 module LogStash module Filters module Jdbc class Validatable def self.find_validation_errors(options) array_of_options = Array(options) errors = [] array_of_options.each do |options| instance = new(options) unless instance.valid? errors << instance.formatted_errors end end return nil if errors.empty? errors.join("; ") end def initialize(options) pre_initialize(options) @options = options @valid = false @option_errors = [] parse_options post_initialize end def valid? @valid end def formatted_errors @option_errors.join(", ") end private def pre_initialize(options) end def post_initialize end def parse_options raise "Subclass must implement 'parse_options'" end end end end end
Version data entries
46 entries across 46 versions & 2 rubygems