Class: Olyx::Guardrails::PolicyRuleComponents::MatchConfiguration
- Inherits:
-
Object
- Object
- Olyx::Guardrails::PolicyRuleComponents::MatchConfiguration
- Defined in:
- lib/olyx/guardrails/policy_rule/configuration.rb
Overview
Validated policy-rule matching configuration.
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#patterns ⇒ Object
readonly
Returns the value of attribute patterns.
Instance Method Summary collapse
-
#initialize(patterns, terms, match) ⇒ MatchConfiguration
constructor
A new instance of MatchConfiguration.
Constructor Details
#initialize(patterns, terms, match) ⇒ MatchConfiguration
Returns a new instance of MatchConfiguration.
31 32 33 34 35 |
# File 'lib/olyx/guardrails/policy_rule/configuration.rb', line 31 def initialize(patterns, terms, match) @mode = MATCH_MODE.call(match) @patterns = PatternCompiler.call(patterns: patterns, terms: terms, match: @mode) freeze end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
29 30 31 |
# File 'lib/olyx/guardrails/policy_rule/configuration.rb', line 29 def mode @mode end |
#patterns ⇒ Object (readonly)
Returns the value of attribute patterns.
29 30 31 |
# File 'lib/olyx/guardrails/policy_rule/configuration.rb', line 29 def patterns @patterns end |