Module: QueryPackwerk::QueryInterface
- Extended by:
- T::Generic, T::Sig
- Includes:
- Enumerable, Kernel
- Included in:
- Packages, Violations
- Defined in:
- lib/query_packwerk/query_interface.rb
Overview
A mixin module providing a flexible query interface for collections. Implements methods for filtering, comparing, and manipulating collection data with a consistent API pattern. Extends included classes with class methods for advanced querying capabilities and integrates with Enumerable for additional collection functionality.
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- Elem =
type_member
Class Method Summary collapse
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #original_collection ⇒ Object
- #size ⇒ Object (also: #length, #count)
Class Method Details
.included(klass) ⇒ Object
59 60 61 |
# File 'lib/query_packwerk/query_interface.rb', line 59 def self.included(klass) klass.extend(ClassMethods) end |
Instance Method Details
#each(&block) ⇒ Object
32 33 34 35 36 |
# File 'lib/query_packwerk/query_interface.rb', line 32 def each(&block) return enum_for(:each) unless block_given? original_collection.each(&block) end |
#original_collection ⇒ Object
42 43 44 |
# File 'lib/query_packwerk/query_interface.rb', line 42 def original_collection [] end |
#size ⇒ Object Also known as: length, count
48 49 50 |
# File 'lib/query_packwerk/query_interface.rb', line 48 def size original_collection.size end |