Class: Coppertone::RedirectRecordFinder
- Inherits:
-
Object
- Object
- Coppertone::RedirectRecordFinder
- Defined in:
- lib/coppertone/redirect_record_finder.rb
Overview
A helper class for finding SPF records for a redirect modifier.
Instance Attribute Summary collapse
-
#macro_context ⇒ Object
readonly
Returns the value of attribute macro_context.
-
#redirect ⇒ Object
readonly
Returns the value of attribute redirect.
-
#request_context ⇒ Object
readonly
Returns the value of attribute request_context.
Instance Method Summary collapse
-
#initialize(redirect, macro_context, request_context) ⇒ RedirectRecordFinder
constructor
A new instance of RedirectRecordFinder.
- #record ⇒ Object
- #target ⇒ Object
Constructor Details
#initialize(redirect, macro_context, request_context) ⇒ RedirectRecordFinder
Returns a new instance of RedirectRecordFinder.
5 6 7 8 9 |
# File 'lib/coppertone/redirect_record_finder.rb', line 5 def initialize(redirect, macro_context, request_context) @redirect = redirect @macro_context = macro_context @request_context = request_context end |
Instance Attribute Details
#macro_context ⇒ Object (readonly)
Returns the value of attribute macro_context.
4 5 6 |
# File 'lib/coppertone/redirect_record_finder.rb', line 4 def macro_context @macro_context end |
#redirect ⇒ Object (readonly)
Returns the value of attribute redirect.
4 5 6 |
# File 'lib/coppertone/redirect_record_finder.rb', line 4 def redirect @redirect end |
#request_context ⇒ Object (readonly)
Returns the value of attribute request_context.
4 5 6 |
# File 'lib/coppertone/redirect_record_finder.rb', line 4 def request_context @request_context end |
Instance Method Details
#record ⇒ Object
15 16 17 18 |
# File 'lib/coppertone/redirect_record_finder.rb', line 15 def record return unless target @record ||= RecordFinder.new(request_context.dns_client, target).record end |
#target ⇒ Object
11 12 13 |
# File 'lib/coppertone/redirect_record_finder.rb', line 11 def target @redirect_target ||= redirect.evaluate(macro_context, request_context) end |