Module: Policy

Defined in:
lib/policy.rb,
lib/policy/cli.rb,
lib/policy/base.rb,
lib/policy/base/or.rb,
lib/policy/version.rb,
lib/policy/base/and.rb,
lib/policy/base/not.rb,
lib/policy/base/xor.rb,
lib/policy/follower.rb,
lib/policy/base/node.rb,
lib/policy/base/negator.rb,
lib/policy/cli/attribute.rb,
lib/policy/follower/policies.rb,
lib/policy/follower/name_error.rb,
lib/policy/follower/violation_error.rb

Overview

The namespace for the code of the ‘policy’ gem

Defined Under Namespace

Modules: Base, Follower Classes: CLI

Constant Summary collapse

VERSION =

The semantic version of the module.

"2.0.0".freeze

Class Method Summary collapse

Class Method Details

.and(*policies) ⇒ Policy::Base

Builds a composite policy by applying method AND to policies

Parameters:

Returns:



28
29
30
# File 'lib/policy.rb', line 28

def self.and(*policies)
  Base::And.new(*policies)
end

.not(policy) ⇒ Policy::Base

Builds the negation of policy

Parameters:

Returns:



55
56
57
# File 'lib/policy.rb', line 55

def self.not(policy)
  Base::Not.new(policy)
end

.or(*policies) ⇒ Policy::Base

Builds a composite policy by applying method OR to policies

Parameters:

Returns:



37
38
39
# File 'lib/policy.rb', line 37

def self.or(*policies)
  Base::Or.new(*policies)
end

.xor(*policies) ⇒ Policy::Base

Builds a composite policy by applying method XOR to policies

Parameters:

Returns:



46
47
48
# File 'lib/policy.rb', line 46

def self.xor(*policies)
  Base::Xor.new(*policies)
end