class Selector::Collection

The condition checks if a value is included to the collection

@example (see [])

Public Class Methods

new(_) click to toggle source

@!method initialize(collection) Initializes the condition with a collection of allowed values

@param [Enumerable] collection

Calls superclass method
# File lib/selector/collection.rb, line 16
def initialize(_)
  super
end

Public Instance Methods

[](value) click to toggle source

Checks if the array includes the value

@example

condition = Set.new [:foo, :bar]
condition[:foo] # => true
condition[:baz] # => false

@param (see Selector::Condition#[])

@return (see Selector::Condition#[])

# File lib/selector/collection.rb, line 31
def [](value)
  attribute.include? value
end