Class: Rubyzen::Collections::ModulesCollection
- Inherits:
-
BaseCollection
- Object
- Array
- BaseCollection
- Rubyzen::Collections::ModulesCollection
- Includes:
- Providers::CollectionFilterProvider
- Defined in:
- lib/rubyzen/collections/modules_collection.rb
Overview
Collection of module declarations with methods for navigating into child elements (methods, classes, constants).
Instance Method Summary collapse
-
#all_methods ⇒ MethodsCollection
Returns all methods defined across every module.
-
#classes ⇒ ClassesCollection
Returns all class declarations nested inside every module.
-
#constants ⇒ ConstantsCollection
Returns all constant declarations across every module.
Methods included from Providers::CollectionFilterProvider
#with_name, #with_name_ending_with, #with_name_including, #with_name_starting_with, #without_name, #without_name_ending_with, #without_name_including, #without_name_starting_with
Methods inherited from BaseCollection
Instance Method Details
#all_methods ⇒ MethodsCollection
Returns all methods defined across every module.
14 15 16 17 |
# File 'lib/rubyzen/collections/modules_collection.rb', line 14 def all_methods all_methods = flat_map(&:all_methods) MethodsCollection.new(all_methods) end |
#classes ⇒ ClassesCollection
Returns all class declarations nested inside every module.
22 23 24 25 |
# File 'lib/rubyzen/collections/modules_collection.rb', line 22 def classes all_classes = flat_map(&:classes) ClassesCollection.new(all_classes) end |
#constants ⇒ ConstantsCollection
Returns all constant declarations across every module.
30 31 32 33 |
# File 'lib/rubyzen/collections/modules_collection.rb', line 30 def constants all_constants = flat_map(&:constants) ConstantsCollection.new(all_constants) end |