class Coppertone::Mechanism::DomainSpecMechanism

Parent class for mechanisms that use a domain spec.

Attributes

domain_spec[R]

Public Class Methods

dns_lookup_term?() click to toggle source
# File lib/coppertone/mechanism/domain_spec_mechanism.rb, line 21
def self.dns_lookup_term?
  true
end

Public Instance Methods

==(other) click to toggle source
# File lib/coppertone/mechanism/domain_spec_mechanism.rb, line 43
def ==(other)
  return false unless other.instance_of? self.class

  domain_spec == other.domain_spec
end
Also aliased as: eql?
context_dependent?() click to toggle source
# File lib/coppertone/mechanism/domain_spec_mechanism.rb, line 25
def context_dependent?
  return true unless domain_spec

  domain_spec.context_dependent?
end
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/coppertone/mechanism/domain_spec_mechanism.rb, line 50
def hash
  domain_spec.hash
end
includes_ptr?() click to toggle source
# File lib/coppertone/mechanism/domain_spec_mechanism.rb, line 31
def includes_ptr?
  return false unless domain_spec

  domain_spec.includes_ptr?
end
target_domain() click to toggle source
# File lib/coppertone/mechanism/domain_spec_mechanism.rb, line 37
def target_domain
  raise Coppertone::NeedsContextError if context_dependent?

  domain_spec.to_s
end
target_name_from_domain_spec(macro_context, request_context) click to toggle source
# File lib/coppertone/mechanism/domain_spec_mechanism.rb, line 7
def target_name_from_domain_spec(macro_context, request_context)
  if domain_spec
    domain =
      domain_spec.expand(macro_context, request_context)
  end
  Coppertone::Utils::DomainUtils.macro_expanded_domain(domain)
end
trim_domain_spec(raw_domain_spec) click to toggle source
# File lib/coppertone/mechanism/domain_spec_mechanism.rb, line 15
def trim_domain_spec(raw_domain_spec)
  return nil if raw_domain_spec.blank?

  raw_domain_spec[1..]
end