Class: Inspec::Resource
- Inherits:
-
Object
- Object
- Inspec::Resource
- Defined in:
- lib/inspec/resource.rb
Class Method Summary collapse
-
.create_dsl(backend, my_registry = registry) ⇒ ResourcesDSL
Creates the inner DSL which includes all resources for creating tests.
- .default_registry ⇒ Object
- .new_registry ⇒ Object
- .registry ⇒ Object
Class Method Details
.create_dsl(backend, my_registry = registry) ⇒ 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.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/inspec/resource.rb', line 28 def self.create_dsl(backend, my_registry = registry) # need the local name, to use it in the module creation further down 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 |
.default_registry ⇒ Object
10 11 12 |
# File 'lib/inspec/resource.rb', line 10 def self.default_registry @default_registry ||= {} end |
.new_registry ⇒ Object
18 19 20 |
# File 'lib/inspec/resource.rb', line 18 def self.new_registry default_registry.dup end |
.registry ⇒ Object
14 15 16 |
# File 'lib/inspec/resource.rb', line 14 def self.registry @registry ||= default_registry end |