Class: Attestor::Policy::Node Private

Inherits:
Object
  • Object
show all
Includes:
Attestor::Policy
Defined in:
lib/attestor/policy/node.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The base class for composite policies

Direct Known Subclasses

And, Not, Or, Xor

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Attestor::Policy

#and, included, #invalid?, #not, #or, #valid?, #xor

Methods included from Validations::ClassMethods

#follow_policy, #follow_validator, #validate, #validators

Methods included from Factory

#and, #not, #or, #xor

Methods included from Validations

included, #invalid, #validate

Class Attribute Details

.branchesArray<Policy::Base> (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The branches of the node

Returns:

  • (Array<Policy::Base>)


31
32
33
# File 'lib/attestor/policy/node.rb', line 31

def branches
  @branches
end

Class Method Details

.initialize(*branches) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
25
# File 'lib/attestor/policy/node.rb', line 22

def initialize(*branches)
  @branches = branches.flatten
  freeze
end

.new(*branches) ⇒ Policy::Base::Node

Creates the node with branches

Parameters:

Returns:

  • (Policy::Base::Node)


# File 'lib/attestor/policy/node.rb', line 13


.validateundefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Validates the policy as invalid

To be reloaded by subclasses (And, Or, Xor, Not)

Returns:

  • (undefined)

Raises:

  • (Policy::InvalidError)


40
41
42
# File 'lib/attestor/policy/node.rb', line 40

def validate
  invalid :base
end