Class: PluginRegistry
- Inherits:
-
Object
- Object
- PluginRegistry
- Defined in:
- lib/inspec/plugin/v1/registry.rb,
lib/inspec/plugin/v1/registry.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Plugin
Instance Attribute Summary collapse
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Method Summary collapse
-
#initialize ⇒ PluginRegistry
constructor
A new instance of PluginRegistry.
-
#resolve(target, opts = {}) ⇒ Plugin
Resolve a target via available plugins.
Constructor Details
#initialize ⇒ PluginRegistry
Returns a new instance of PluginRegistry.
4 5 6 |
# File 'lib/inspec/plugin/v1/registry.rb', line 4 def initialize @registry = {} end |
Instance Attribute Details
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
2 3 4 |
# File 'lib/inspec/plugin/v1/registry.rb', line 2 def registry @registry end |
Instance Method Details
#resolve(target, opts = {}) ⇒ Plugin
Resolve a target via available plugins.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/inspec/plugin/v1/registry.rb', line 12 def resolve(target, opts = {}) modules.each do |m| res = if ["Inspec::Fetcher::Url", "Supermarket::Fetcher"].include? m.to_s m.resolve(target, opts) else m.resolve(target) end return res unless res.nil? end nil end |