Method: SPF::Server#initialize
- Defined in:
- lib/spf/eval.rb
#initialize(options = {}) ⇒ Server
Returns a new instance of Server.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/spf/eval.rb', line 49 def initialize( = {}) @default_authority_explanation = [:default_authority_explanation] || DEFAULT_DEFAULT_AUTHORITY_EXPLANATION unless SPF::MacroString === @default_authority_explanation @default_authority_explanation = SPF::MacroString.new({ :text => @default_authority_explanation, :server => self, :is_explanation => true }) end @hostname = [:hostname] || SPF::Util.hostname @dns_resolver = [:dns_resolver] || Resolv::DNS.new @query_rr_types = [:query_rr_types] || DEFAULT_QUERY_RR_TYPES @max_dns_interactive_terms = [:max_dns_interactive_terms] || DEFAULT_MAX_DNS_INTERACTIVE_TERMS @max_name_lookups_per_term = [:max_name_lookups_per_term] || DEFAULT_MAX_NAME_LOOKUPS_PER_TERM @max_name_lookups_per_mx_mech = [:max_name_lookups_per_mx_mech] || DEFAULT_MAX_NAME_LOOKUPS_PER_MX_MECH @max_name_lookups_per_ptr_mech = [:max_name_lookups_per_ptr_mech] || DEFAULT_MAX_NAME_LOOKUPS_PER_PTR_MECH # TODO: We should probably do this for the above maximums (allow nil maximums). @max_void_dns_lookups = .has_key?(:max_void_dns_lookups) ? [:max_void_dns_lookups] : DEFAULT_MAX_VOID_DNS_LOOKUPS @raise_exceptions = .has_key?(:raise_exceptions) ? [:raise_exceptions] : true end |