Class: Coppertone::Mechanism::IncludeMatcher
- Inherits:
-
Object
- Object
- Coppertone::Mechanism::IncludeMatcher
- Defined in:
- lib/coppertone/mechanism/include_matcher.rb
Overview
Implements the include mechanism.
Defined Under Namespace
Classes: IncludeRecordEvaluator
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(record) ⇒ IncludeMatcher
constructor
A new instance of IncludeMatcher.
- #match?(macro_context, request_context) ⇒ Boolean
Constructor Details
#initialize(record) ⇒ IncludeMatcher
Returns a new instance of IncludeMatcher.
21 22 23 |
# File 'lib/coppertone/mechanism/include_matcher.rb', line 21 def initialize(record) @record = record end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
20 21 22 |
# File 'lib/coppertone/mechanism/include_matcher.rb', line 20 def record @record end |
Instance Method Details
#match?(macro_context, request_context) ⇒ Boolean
25 26 27 28 29 30 31 |
# File 'lib/coppertone/mechanism/include_matcher.rb', line 25 def match?(macro_context, request_context) raise Coppertone::NoneIncludeResultError if record.nil? record_result = IncludeRecordEvaluator.new(record) .evaluate(macro_context, request_context) record_result.pass? end |