Class: Oga::Blacklist Private
- Inherits:
-
Object
- Object
- Oga::Blacklist
- Defined in:
- lib/oga/blacklist.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#names ⇒ Set
readonly
private
Instance Method Summary collapse
-
#+(other) ⇒ Oga::Blacklist
private
-
#allow?(name) ⇒ TrueClass|FalseClass
private
-
#each {|| ... } ⇒ Object
private
-
#initialize(names) ⇒ Blacklist
constructor
private
A new instance of Blacklist.
Constructor Details
#initialize(names) ⇒ Blacklist
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Blacklist
8 9 10 |
# File 'lib/oga/blacklist.rb', line 8 def initialize(names) @names = Set.new(names + names.map(&:upcase)) end |
Instance Attribute Details
#names ⇒ Set (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
5 6 7 |
# File 'lib/oga/blacklist.rb', line 5 def names @names end |
Instance Method Details
#+(other) ⇒ Oga::Blacklist
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/oga/blacklist.rb', line 26 def +(other) self.class.new(names + other.names) end |
#allow?(name) ⇒ TrueClass|FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/oga/blacklist.rb', line 20 def allow?(name) !names.include?(name) end |
#each {|| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 16 17 |
# File 'lib/oga/blacklist.rb', line 13 def each names.each do |value| yield value end end |