Class: Coradoc::Element::AttributeList::Matchers::Many
- Inherits:
-
Object
- Object
- Coradoc::Element::AttributeList::Matchers::Many
- Defined in:
- lib/coradoc/element/attribute_list.rb
Overview
TODO: Find a way to only reject some values but not all?
Instance Method Summary collapse
- #===(other) ⇒ Object
-
#initialize(*possibilities) ⇒ Many
constructor
A new instance of Many.
Constructor Details
#initialize(*possibilities) ⇒ Many
Returns a new instance of Many.
123 124 125 |
# File 'lib/coradoc/element/attribute_list.rb', line 123 def initialize(*possibilities) @possibilities = possibilities end |
Instance Method Details
#===(other) ⇒ Object
127 128 129 130 131 132 |
# File 'lib/coradoc/element/attribute_list.rb', line 127 def ===(other) other = other.split(",") if other.is_a?(String) other.is_a?(Array) && other.all? { |i| @possibilities.any? { |p| p === i } } end |