Class: Ace::Support::Nav::Molecules::SourceRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/ace/support/nav/molecules/source_registry.rb

Overview

Discovers and manages protocol source registrations

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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_cacheObject

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