Class: SPF::Record::V1
Constant Summary
collapse
- MECH_CLASSES =
{
:all => SPF::Mech::All,
:ip4 => SPF::Mech::IP4,
:ip6 => SPF::Mech::IP6,
:a => SPF::Mech::A,
:mx => SPF::Mech::MX,
:ptr => SPF::Mech::PTR,
:exists => SPF::Mech::Exists,
:include => SPF::Mech::Include
}
- MOD_CLASSES =
{
:redirect => SPF::Mod::Redirect,
:exp => SPF::Mod::Exp,
}
Constants inherited
from SPF::Record
DEFAULT_QUALIFIER, RESULTS_BY_QUALIFIER
Instance Attribute Summary
Attributes inherited from SPF::Record
#errors, #terms, #text
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from SPF::Record
#error, #eval, #global_mod, #global_mods, #ip_netblocks, new_from_string, #parse, #parse_term, #parse_version_tag, #to_s
Constructor Details
#initialize(options = {}) ⇒ V1
Returns a new instance of V1.
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
|
# File 'lib/spf/model.rb', line 1063
def initialize(options = {})
super(options)
@scopes ||= options[:scopes]
if @scopes and scopes.any?
unless @scopes.length > 0
raise SPF::InvalidScopeError.new('No scopes for v=spf1 record')
end
if @scopes.length == 2
unless (
@scopes[0] == :helo and @scopes[1] == :mfrom or
@scopes[0] == :mfrom and @scopes[1] == :helo)
raise SPF::InvalidScope.new(
"Invalid set of scopes " + @scopes.map{|x| "'#{x}'"}.join(', ') + "for v=spf1 record")
end
end
end
end
|
Class Method Details
.version_tag ⇒ Object
1051
1052
1053
|
# File 'lib/spf/model.rb', line 1051
def self.version_tag
'v=spf1'
end
|
Instance Method Details
#mech_classes ⇒ Object
1059
1060
1061
|
# File 'lib/spf/model.rb', line 1059
def mech_classes
MECH_CLASSES
end
|
#scopes ⇒ Object
1043
1044
1045
|
# File 'lib/spf/model.rb', line 1043
def scopes
[:helo, :mfrom]
end
|
#version_tag ⇒ Object
1047
1048
1049
|
# File 'lib/spf/model.rb', line 1047
def version_tag
'v=spf1'
end
|
#version_tag_pattern ⇒ Object
1055
1056
1057
|
# File 'lib/spf/model.rb', line 1055
def version_tag_pattern
" v=spf(1) (?= \\x20+ | $ ) "
end
|