Class: CQL::NameFilter

Inherits:
ContentMatchFilter show all
Defined in:
lib/cql/filters.rb

Overview

Not a part of the public API. Subject to change at any time.

Instance Attribute Summary

Attributes inherited from ContentMatchFilter

#pattern

Instance Method Summary collapse

Methods inherited from ContentMatchFilter

#content_match?, #initialize

Constructor Details

This class inherits a constructor from CQL::ContentMatchFilter

Instance Method Details

#execute(input, negate) ⇒ Object

Filters the input models so that only the desired ones are returned



86
87
88
89
90
91
92
# File 'lib/cql/filters.rb', line 86

def execute(input, negate)
  method = negate ? :reject : :select

  input.send(method) do |object|
    content_match?([object.name])
  end
end