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
26 27 28 29 |
# File 'lib/lutaml/uml_repository/query_dsl/conditions/hash_condition.rb', line 26 def initialize(conditions) super() @conditions = conditions end |
Instance Method Details
#apply(results) ⇒ Array
Apply hash-based filtering to results
35 36 37 38 39 40 41 |
# File 'lib/lutaml/uml_repository/query_dsl/conditions/hash_condition.rb', line 35 def apply(results) results.select do |obj| @conditions.all? do |key, value| matches_condition?(obj, key, value) end end end |