class CQL::TagFilter
Not a part of the public API. Subject to change at any time.
Attributes
Public Class Methods
new(tags)
click to toggle source
Creates a new filter
# File lib/cql/filters.rb, line 10 def initialize tags @tags = tags end
Public Instance Methods
execute(objects, negate)
click to toggle source
Filters the input models so that only the desired ones are returned
# File lib/cql/filters.rb, line 24 def execute(objects, negate) method = negate ? :reject : :select objects.send(method) { |object| has_tags?(object, tags) } end