Class: Lutaml::UmlRepository::QueryDSL::Conditions::HashCondition
- Inherits:
-
BaseCondition
- Object
- BaseCondition
- Lutaml::UmlRepository::QueryDSL::Conditions::HashCondition
- Defined in:
- lib/lutaml/uml_repository/query_dsl/conditions/hash_condition.rb
Overview
Hash-based condition for filtering query results
Filters results based on attribute-value pairs specified in a hash. All conditions must match for an object to be included in results.
Instance Method Summary collapse
-
#apply(results) ⇒ Array
Apply hash-based filtering to results.
-
#initialize(conditions) ⇒ HashCondition
constructor
Initialize with hash conditions.
Constructor Details
#initialize(conditions) ⇒ HashCondition
Initialize with hash conditions
28 29 30 31 |
# File 'lib/lutaml/uml_repository/query_dsl/conditions/hash_condition.rb', line 28 def initialize(conditions) super() @conditions = conditions end |
Instance Method Details
#apply(results) ⇒ Array
Apply hash-based filtering to results
37 38 39 40 41 42 43 |
# File 'lib/lutaml/uml_repository/query_dsl/conditions/hash_condition.rb', line 37 def apply(results) results.select do |obj| @conditions.all? do |key, value| matches_condition?(obj, key, value) end end end |