Class: Shanty::Discoverer
- Inherits:
-
Object
- Object
- Shanty::Discoverer
- Defined in:
- lib/shanty/discoverer.rb
Overview
Public: Enables discovery of different types of project utilises inherited class method to find all implementing classes
Direct Known Subclasses
Class Attribute Summary collapse
-
.discoverers ⇒ Object
readonly
Returns the value of attribute discoverers.
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Class Method Summary collapse
Instance Method Summary collapse
- #discover_all ⇒ Object
-
#initialize(env) ⇒ Discoverer
constructor
A new instance of Discoverer.
Constructor Details
#initialize(env) ⇒ Discoverer
Returns a new instance of Discoverer.
15 16 17 |
# File 'lib/shanty/discoverer.rb', line 15 def initialize(env) @env = env end |
Class Attribute Details
.discoverers ⇒ Object (readonly)
Returns the value of attribute discoverers.
10 11 12 |
# File 'lib/shanty/discoverer.rb', line 10 def discoverers @discoverers end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
13 14 15 |
# File 'lib/shanty/discoverer.rb', line 13 def env @env end |
Class Method Details
Instance Method Details
#discover_all ⇒ Object
25 26 27 28 29 |
# File 'lib/shanty/discoverer.rb', line 25 def discover_all self.class.discoverers.flat_map do |discoverer| discoverer.new(env).discover end end |