Sha256: 827599087f213c2cd603a96bfe626635024b161324f9991835b4dee0eeef6137

Contents?: true

Size: 466 Bytes

Versions: 7

Compression:

Stored size: 466 Bytes

Contents

module UseCaseValidations
  
  class Validator

    attr_reader :options
    attr_accessor :base

    def initialize(options = {})
      @options  = Helpers._except(options, :class).freeze
    end

    # Override this method in subclasses with validation logic, adding errors
    # to the records +errors+ array where necessary.
    def validate(record)
      raise NotImplementedError, "Subclasses must implement a validate(record) method."
    end
    
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
usecasing_validations-0.7.0 lib/usecasing_validations/validator.rb
usecasing_validations-0.6.0 lib/usecasing_validations/validator.rb
usecasing_validations-0.5.5 lib/usecasing_validations/validator.rb
usecasing_validations-0.5.4 lib/usecasing_validations/validator.rb
usecasing_validations-0.5.3 lib/usecasing_validations/validator.rb
usecasing_validations-0.5.1 lib/usecasing_validations/validator.rb
usecasing_validations-0.5.0 lib/usecasing_validations/validator.rb