class CQL::TypeCountFilter

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

Attributes

comparison[R]

the types of object that will be filtered against

types[R]

the types of object that will be filtered against

Public Class Methods

new(types, comparison) click to toggle source

Creates a new filter

# File lib/cql/filters.rb, line 65
def initialize types, comparison
  @types = types
  @comparison = comparison
end

Public Instance Methods

execute(input, negate) click to toggle source

Not a part of the public API. Subject to change at any time. Filters the input models so that only the desired ones are returned

# File lib/cql/filters.rb, line 72
def execute(input, negate)
  method = negate ? :reject : :select

  input.send(method) do |object|
    type_count(object).send(comparison.operator, comparison.amount)
  end
end