Class: Avm::Registry::WithPath
- Inherits:
-
FromGems
show all
- Defined in:
- lib/avm/registry/with_path.rb,
lib/avm/registry/with_path/cache.rb
Defined Under Namespace
Classes: Cache
Instance Method Summary
collapse
Methods inherited from FromGems
#available, #detect, #detect_optional, #provider_module_suffix, #single_module_suffix, #valid_registered_module?
Methods inherited from Base
#available, #to_s
Instance Method Details
#class_detect(klass, detect_args) ⇒ Object?
9
10
11
12
|
# File 'lib/avm/registry/with_path.rb', line 9
def class_detect(klass, detect_args)
r = klass.new(*detect_args)
r.valid? ? r : nil
end
|
#detect_by_path(path) ⇒ Object
14
15
16
|
# File 'lib/avm/registry/with_path.rb', line 14
def detect_by_path(path)
detect_by_path_optional(path) || raise_not_found(path)
end
|
#detect_by_path_optional(path) ⇒ Object
18
19
20
21
22
|
# File 'lib/avm/registry/with_path.rb', line 18
def detect_by_path_optional(path)
on_cache do
cache.detect_optional(path)
end
end
|