lib/public_suffix/rule.rb in public_suffix-2.0.4 vs lib/public_suffix/rule.rb in public_suffix-2.0.5
- old
+ new
@@ -1,10 +1,10 @@
# = Public Suffix
#
# Domain name parser based on the Public Suffix List.
#
-# Copyright (c) 2009-2016 Simone Carletti <weppos@weppos.net>
+# Copyright (c) 2009-2017 Simone Carletti <weppos@weppos.net>
module PublicSuffix
# A Rule is a special object which holds a single definition
# of the Public Suffix List.
@@ -173,17 +173,10 @@
end
# Normal represents a standard rule (e.g. com).
class Normal < Base
- # Initializes a new rule from +definition+.
- #
- # @param definition [String] the rule as defined in the PSL
- def initialize(definition, **options)
- super(definition, **options)
- end
-
# Gets the original rule definition.
#
# @return [String] The rule definition.
def rule
value
@@ -224,12 +217,12 @@
#
# The wildcard "*" is removed from the value, as it's common
# for each wildcard rule.
#
# @param definition [String] the rule as defined in the PSL
- def initialize(definition, **options)
- super(definition.to_s[2..-1], **options)
+ def initialize(definition, private: false)
+ super(definition.to_s[2..-1], private: private)
end
# Gets the original rule definition.
#
# @return [String] The rule definition.
@@ -273,12 +266,12 @@
#
# The bang ! is removed from the value, as it's common
# for each wildcard rule.
#
# @param definition [String] the rule as defined in the PSL
- def initialize(definition, **options)
- super(definition.to_s[1..-1], **options)
+ def initialize(definition, private: false)
+ super(definition.to_s[1..-1], private: private)
end
# Gets the original rule definition.
#
# @return [String] The rule definition.
@@ -336,18 +329,18 @@
# PublicSuffix::Rule.factory("!congresodelalengua3.ar")
# # => #<PublicSuffix::Rule::Exception>
#
# @param [String] content The rule content.
# @return [PublicSuffix::Rule::*] A rule instance.
- def self.factory(content, **options)
+ def self.factory(content, private: false)
case content.to_s[0, 1]
when STAR
Wildcard
when BANG
Exception
else
Normal
- end.new(content, **options)
+ end.new(content, private: private)
end
# The default rule to use if no rule match.
#
# The default rule is "*". From https://publicsuffix.org/list/: