class J2119::RoleNotPresentCondition
to be applied to a role/constraint combo, so the constraint is applied
conditionally
These all respond_to constraint_applies
(node, roles)
- node is the JSON node being checked - roles is the roles the node currently has
Public Class Methods
new(exclude_roles)
click to toggle source
# File lib/j2119/conditional.rb, line 26 def initialize(exclude_roles) @excluded_roles = exclude_roles end
Public Instance Methods
constraint_applies(node, roles)
click to toggle source
# File lib/j2119/conditional.rb, line 34 def constraint_applies(node, roles) (roles & @excluded_roles).empty? end
to_s()
click to toggle source
# File lib/j2119/conditional.rb, line 30 def to_s "excluded roles: #{@excluded_roles}" end