Class: Selector::Collection
- Defined in:
- lib/selector/collection.rb
Overview
The condition checks if a value is included to the collection
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Condition
Instance Method Summary collapse
-
#[](value) ⇒ Boolean
Checks if the array includes the value.
-
#initialize(collection) ⇒ Collection
constructor
Initializes the condition with a collection of allowed values.
Methods inherited from Condition
#!, #&, #-, #==, #attribute, #|
Constructor Details
#initialize(collection) ⇒ Collection
Initializes the condition with a collection of allowed values
16 17 18 |
# File 'lib/selector/collection.rb', line 16 def initialize(_) super end |
Instance Method Details
#[](value) ⇒ Boolean
Checks if the array includes the value
31 32 33 |
# File 'lib/selector/collection.rb', line 31 def [](value) attribute.include? value end |