class Selector::Array

The condition checks if a value is included to the array

Public Class Methods

new(array) click to toggle source

@private

Calls superclass method
# File lib/selector/array.rb, line 10
def initialize(array)
  super Set.new(array)
end

Public Instance Methods

&(other) click to toggle source

Creates an AND composition

If other value is a array, then creates modified array to avoid nesting

@param (see Selector::Composition#&)

@return (see Selector::Composition#&)

Calls superclass method
# File lib/selector/array.rb, line 22
def &(other)
  return super unless other.instance_of? self.class
  self.class.new attribute & other.attribute
end
|(other) click to toggle source

Creates an OR composition

If other value is a array, then creates modified array to avoid nesting

@param (see Selector::Composition#|)

@return (see Selector::Composition#|)

Calls superclass method
# File lib/selector/array.rb, line 35
def |(other)
  return super unless other.instance_of? self.class
  self.class.new attribute | other.attribute
end