Class: Coppertone::Mechanism::Include
- Inherits:
-
DomainSpecRequired
- Object
- Coppertone::Mechanism
- DomainSpecMechanism
- DomainSpecRequired
- Coppertone::Mechanism::Include
- Defined in:
- lib/coppertone/mechanism/include.rb
Overview
Implements the include mechanism.
Instance Attribute Summary
Attributes inherited from DomainSpecMechanism
Attributes inherited from Coppertone::Mechanism
Class Method Summary collapse
Instance Method Summary collapse
- #context_for_include(macro_context, target_name) ⇒ Object
- #included_record(request_context, target_name) ⇒ Object
- #match_target_name(macro_context, request_context, target_name) ⇒ Object
Methods inherited from DomainSpecRequired
create, #handle_invalid_domain, #initialize, #match?
Methods inherited from DomainSpecMechanism
#==, #context_dependent?, dns_lookup_term?, #hash, #includes_ptr?, #target_domain, #target_name_from_domain_spec, #trim_domain_spec
Methods inherited from Coppertone::Mechanism
build, class_builder, #context_dependent?, dns_lookup_term?, #dns_lookup_term?, #includes_ptr?, #initialize, register, #to_s
Constructor Details
This class inherits a constructor from Coppertone::Mechanism::DomainSpecRequired
Class Method Details
.label ⇒ Object
24 25 26 |
# File 'lib/coppertone/mechanism/include.rb', line 24 def self.label 'include' end |
Instance Method Details
#context_for_include(macro_context, target_name) ⇒ Object
16 17 18 |
# File 'lib/coppertone/mechanism/include.rb', line 16 def context_for_include(macro_context, target_name) macro_context.with_domain(target_name) end |
#included_record(request_context, target_name) ⇒ Object
20 21 22 |
# File 'lib/coppertone/mechanism/include.rb', line 20 def included_record(request_context, target_name) RecordFinder.new(request_context.dns_client, target_name).record end |
#match_target_name(macro_context, request_context, target_name) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/coppertone/mechanism/include.rb', line 9 def match_target_name(macro_context, request_context, target_name) record = included_record(request_context, target_name) IncludeMatcher.new(record) .match?(context_for_include(macro_context, target_name), request_context) end |