lib/spf/model.rb in spf-0.0.5 vs lib/spf/model.rb in spf-0.0.6

- old
+ new

@@ -83,19 +83,19 @@ :: (?: #{HEXWORD_PATTERN} : ){0,5} #{TWO_HEXWORDS_OR_IPV4_ADDRESS_PATTERN} | # :: | - :: " - attr_reader :ip_address, :ip_network, :ipv4_prefix_length, :ipv6_prefix_length - attr_accessor :errors + attr_reader :errors, :ip_netblocks, :ip_address, :ip_network, :ipv4_prefix_length, :ipv6_prefix_length def initialize(options = {}) @ip_address = nil @ip_network = nil @ipv4_prefix_length = nil @ipv6_prefix_length = nil @errors = [] + @ip_netblocks = [] end def error(exception) @errors << exception raise exception @@ -203,12 +203,10 @@ end class SPF::Mech < SPF::Term - attr_reader :ip_netblocks, :errors - DEFAULT_QUALIFIER = SPF::Record::DEFAULT_QUALIFIER def default_ipv4_prefix_length; 32; end def default_ipv6_prefix_length; 128; end QUALIFIER_PATTERN = '[+\\-~\\?]' @@ -222,12 +220,10 @@ } def initialize(options) super(options) - @ip_netblocks = [] - @text = options[:text] if not self.instance_variable_defined?(:@parse_text) @parse_text = @text.dup end if self.instance_variable_defined?(:@domain_spec) and @@ -600,9 +596,11 @@ end class SPF::Mod < SPF::Term def initialize(options = {}) + super + @parse_text = options[:parse_text] @text = options[:text] @domain_spec = options[:domain_spec] @parse_text = @text.dup unless @parse_text