Class: PluginRegistry
- Inherits:
-
Object
- Object
- PluginRegistry
- Defined in:
- lib/inspec/plugin/v1/registry.rb,
lib/inspec/plugin/v1/registry.rb
Overview
author: Dominik Richter author: Christoph Hartmann
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) ⇒ Plugin
Resolve a target via available plugins.
Constructor Details
#initialize ⇒ PluginRegistry
Returns a new instance of PluginRegistry.
8 9 10 |
# File 'lib/inspec/plugin/v1/registry.rb', line 8 def initialize @registry = {} end |
Instance Attribute Details
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
6 7 8 |
# File 'lib/inspec/plugin/v1/registry.rb', line 6 def registry @registry end |
Instance Method Details
#resolve(target) ⇒ Plugin
Resolve a target via available plugins.
16 17 18 19 20 21 22 |
# File 'lib/inspec/plugin/v1/registry.rb', line 16 def resolve(target) modules.each do |m| res = m.resolve(target) return res unless res.nil? end nil end |