Class: CQL::TypeCountFilter
- Inherits:
-
Object
- Object
- CQL::TypeCountFilter
- Defined in:
- lib/cql/filters.rb
Overview
Not a part of the public API. Subject to change at any time.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#comparison ⇒ Object
readonly
the types of object that will be filtered against.
-
#types ⇒ Object
readonly
the types of object that will be filtered against.
Instance Method Summary collapse
-
#execute(input, negate) ⇒ Object
Not a part of the public API.
-
#initialize(types, comparison) ⇒ TypeCountFilter
constructor
Creates a new filter.
Constructor Details
#initialize(types, comparison) ⇒ TypeCountFilter
Creates a new filter
65 66 67 68 |
# File 'lib/cql/filters.rb', line 65 def initialize types, comparison @types = types @comparison = comparison end |
Instance Attribute Details
#comparison ⇒ Object (readonly)
the types of object that will be filtered against
60 61 62 |
# File 'lib/cql/filters.rb', line 60 def comparison @comparison end |
#types ⇒ Object (readonly)
the types of object that will be filtered against
60 61 62 |
# File 'lib/cql/filters.rb', line 60 def types @types end |
Instance Method Details
#execute(input, negate) ⇒ Object
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
72 73 74 75 76 77 78 |
# 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 |