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.
12 13 14 |
# File 'lib/oga/blacklist.rb', line 12 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.
7 8 9 |
# File 'lib/oga/blacklist.rb', line 7 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.
36 37 38 |
# File 'lib/oga/blacklist.rb', line 36 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.
28 29 30 |
# File 'lib/oga/blacklist.rb', line 28 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.
19 20 21 22 23 |
# File 'lib/oga/blacklist.rb', line 19 def each names.each do |value| yield value end end |