Sha256: 008791ae0b5f59d9a04dcd043b3cd67bcad3e80f3daa6d92c365d8b6af167bf1

Contents?: true

Size: 711 Bytes

Versions: 4

Compression:

Stored size: 711 Bytes

Contents

# encoding: utf-8

module Attestor

  module Policy

    # AND-concatenation of several policies (branches)
    #
    # The policy is valid if all its branches are valid.
    #
    # @example (see #validate)
    #
    # @api private
    class And < Node

      # Checks whether every policy is valid
      #
      # @example
      #   first.valid?  # => true
      #   second.valid? # => false
      #
      #   composition = Attestor::Policy::And.new(first, second)
      #   composition.validate
      #   # => Policy::InvalidError
      #
      # @return [undefined]
      def validate
        return unless any_invalid?
        super
      end

    end # class And

  end # module Base

end # module Policy

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
attestor-0.3.0 lib/attestor/policy/and.rb
attestor-0.2.0 lib/attestor/policy/and.rb
attestor-0.1.0 lib/attestor/policy/and.rb
attestor-0.0.1 lib/attestor/policy/and.rb