Class: Ace::Support::Nav::Molecules::SourceRegistry
- Inherits:
-
Object
- Object
- Ace::Support::Nav::Molecules::SourceRegistry
- Defined in:
- lib/ace/support/nav/molecules/source_registry.rb
Overview
Discovers and manages protocol source registrations
Instance Attribute Summary collapse
-
#start_path ⇒ Object
readonly
Returns the value of attribute start_path.
Instance Method Summary collapse
-
#clear_cache ⇒ Object
Clear the cache.
-
#initialize(start_path: nil) ⇒ SourceRegistry
constructor
A new instance of SourceRegistry.
-
#sources_for_protocol(protocol) ⇒ Object
Get all sources for a protocol.
Constructor Details
#initialize(start_path: nil) ⇒ SourceRegistry
Returns a new instance of SourceRegistry.
18 19 20 21 |
# File 'lib/ace/support/nav/molecules/source_registry.rb', line 18 def initialize(start_path: nil) @start_path = start_path @sources_cache = {} end |
Instance Attribute Details
#start_path ⇒ Object (readonly)
Returns the value of attribute start_path.
16 17 18 |
# File 'lib/ace/support/nav/molecules/source_registry.rb', line 16 def start_path @start_path end |
Instance Method Details
#clear_cache ⇒ Object
Clear the cache
29 30 31 |
# File 'lib/ace/support/nav/molecules/source_registry.rb', line 29 def clear_cache @sources_cache.clear end |
#sources_for_protocol(protocol) ⇒ Object
Get all sources for a protocol
24 25 26 |
# File 'lib/ace/support/nav/molecules/source_registry.rb', line 24 def sources_for_protocol(protocol) @sources_cache[protocol] ||= discover_sources(protocol) end |