Class: Avm::Registry::Sources

Inherits:
WithPath show all
Defined in:
lib/avm/registry/sources.rb

Instance Method Summary collapse

Methods inherited from WithPath

#class_detect, #detect_by_path, #detect_by_path_optional

Methods inherited from FromGems

#available, #class_detect, #detect, #provider_module_suffix, #single_module_suffix, #to_s, #valid_registered_module?

Instance Method Details

#application_stereotype_by_name(name) ⇒ Avm::ApplicationStereotypes::Base



9
10
11
# File 'lib/avm/registry/sources.rb', line 9

def application_stereotype_by_name(name)
  ::Avm::Registry.application_stereotypes.detect(name)
end

#detect_optional(*detect_args) ⇒ Avm::Sources::Base?

Returns:



14
15
16
# File 'lib/avm/registry/sources.rb', line 14

def detect_optional(*detect_args)
  detect_optional_by_configuration(*detect_args) || super
end

#detect_optional_by_configuration(path, *detect_args) ⇒ Avm::Sources::Base?

Returns:



19
20
21
22
23
# File 'lib/avm/registry/sources.rb', line 19

def detect_optional_by_configuration(path, *detect_args)
  source_configured_stereotype_name(path).if_present do |v|
    application_stereotype_by_name(v).source_class.new(path, *detect_args)
  end
end

#source_configured_stereotype_name(path) ⇒ String

Returns:

  • (String)


26
27
28
# File 'lib/avm/registry/sources.rb', line 26

def source_configured_stereotype_name(path)
  ::Avm::Sources::Base.new(path).stereotype_name_by_configuration
end