Class: Inspec::Resource
- Inherits:
-
Object
- Object
- Inspec::Resource
- Defined in:
- lib/inspec/resource.rb
Class Method Summary collapse
-
.create_dsl(backend) ⇒ ResourcesDSL
Creates the inner DSL which includes all resources for creating tests.
- .registry ⇒ Object
Class Method Details
.create_dsl(backend) ⇒ ResourcesDSL
Creates the inner DSL which includes all resources for creating tests. It is always connected to one target, which is specified via the backend argument.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/inspec/resource.rb', line 21 def self.create_dsl(backend) # need the local name, to use it in the module creation further down my_registry = registry Module.new do my_registry.each do |id, r| define_method id.to_sym do |*args| r.new(backend, id.to_s, *args) end end end end |
.registry ⇒ Object
11 12 13 |
# File 'lib/inspec/resource.rb', line 11 def self.registry @registry ||= {} end |