Sha256: b51f329199cb3c3d5fc8af1fbf045ab58a7c19dde308190a78f34f0d038a9123

Contents?: true

Size: 430 Bytes

Versions: 48

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true

module Ree::Contracts
  class BaseValidator
    include Ree::Contracts::Truncatable

    attr_reader :contract
    
    def initialize(contract)
      @contract = contract
    end

    def to_s
      raise NotImplementedError
    end

    def call(value)
      raise NotImplementedError
    end

    private

    def pluralize(num, single, plural)
      num == 1 ? single : plural
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
ree-1.0.47 lib/ree/contracts/validators/base_validator.rb
ree-1.0.46 lib/ree/contracts/validators/base_validator.rb
ree-1.0.45 lib/ree/contracts/validators/base_validator.rb
ree-1.0.44 lib/ree/contracts/validators/base_validator.rb
ree-1.0.43 lib/ree/contracts/validators/base_validator.rb
ree-1.0.42 lib/ree/contracts/validators/base_validator.rb
ree-1.0.41 lib/ree/contracts/validators/base_validator.rb
ree-1.0.40 lib/ree/contracts/validators/base_validator.rb
ree-1.0.39 lib/ree/contracts/validators/base_validator.rb
ree-1.0.38 lib/ree/contracts/validators/base_validator.rb
ree-1.0.37 lib/ree/contracts/validators/base_validator.rb
ree-1.0.36 lib/ree/contracts/validators/base_validator.rb
ree-1.0.35 lib/ree/contracts/validators/base_validator.rb
ree-1.0.34 lib/ree/contracts/validators/base_validator.rb
ree-1.0.33 lib/ree/contracts/validators/base_validator.rb
ree-1.0.32 lib/ree/contracts/validators/base_validator.rb
ree-1.0.31 lib/ree/contracts/validators/base_validator.rb
ree-1.0.30 lib/ree/contracts/validators/base_validator.rb
ree-1.0.29 lib/ree/contracts/validators/base_validator.rb
ree-1.0.28 lib/ree/contracts/validators/base_validator.rb