Module: Peregrine::Collections
- Defined in:
- lib/peregrine/collections.rb,
lib/peregrine/collections/named.rb,
lib/peregrine/collections/common.rb,
lib/peregrine/collections/tagged.rb,
lib/peregrine/collections/systemic.rb,
lib/peregrine/collections/composite.rb
Overview
This module provides modules which define instance methods to be used by collections (such as arrays or hashes) with methods for filtering thier collected items. These modules are designed to be extensions to instances of collections so as not to pollute the default Ruby collections.
Note that arrays returned from any of these modules are already extended with all of the defined collection modules, facilitating chaining of collection filtering methods.
Defined Under Namespace
Modules: Common, Composite, Named, Systemic, Tagged
Class Method Summary collapse
-
.extended(parent) ⇒ Object
Extends all of the constants defined within this module to the parent which is extended by this module – essentially a shortcut to extend with all of the defined collections.
Class Method Details
.extended(parent) ⇒ Object
Extends all of the constants defined within this module to the parent which is extended by this module – essentially a shortcut to extend with all of the defined collections.
21 22 23 |
# File 'lib/peregrine/collections.rb', line 21 def self.extended(parent) parent.send(:extend, *constants.map { |const| const_get(const) }) end |