Permalink
Browse files

Added code review improvements

  • Loading branch information...
rb2k committed Apr 2, 2013
1 parent c53eec3 commit f2e772a2900ef24b5e0f2bcb8b667ef9f9a68d4d
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/public_suffix/list.rb
View
@@ -70,8 +70,8 @@ def self.default=(value)
# Shows if support for private (non-ICANN) domains is enabled or not
#
# @return [Boolean]
- def self.private_domains
- @private_domains == true || @private_domains.nil?
+ def self.private_domains?
+ @private_domains != false
end
# Enables/disables support for private (non-ICANN) domains
@@ -80,8 +80,8 @@ def self.private_domains
#
# @return [PublicSuffix::List]
def self.private_domains=(value)
- @private_domains = (value == true)
- self.reload
+ @private_domains = !!value
+ self.clear
end
# Sets the default rule list to +nil+.
@@ -121,7 +121,7 @@ def self.parse(input)
new do |list|
input.each_line do |line|
line.strip!
- break if !@private_domains && line.include?('===BEGIN PRIVATE DOMAINS===')
+ break if !private_domains? && line.include?('===BEGIN PRIVATE DOMAINS===')
# strip blank lines
if line.empty?
next

0 comments on commit f2e772a

Please sign in to comment.