Class: Inspec::DescribeBase
- Inherits:
-
Object
- Object
- Inspec::DescribeBase
show all
- Includes:
- InputDslHelpers
- Defined in:
- lib/inspec/describe_base.rb
Instance Method Summary
collapse
#input_with_profile_id
Constructor Details
Returns a new instance of DescribeBase.
8
9
10
11
|
# File 'lib/inspec/describe_base.rb', line 8
def initialize(action)
@action = action
@checks = []
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments) ⇒ Object
33
34
35
|
# File 'lib/inspec/describe_base.rb', line 33
def method_missing(method_name, *arguments)
Inspec::DSL.method_missing_resource(inspec, method_name, *arguments)
end
|
Instance Method Details
#describe(*args, &block) ⇒ Object
37
38
39
|
# File 'lib/inspec/describe_base.rb', line 37
def describe(*args, &block)
@checks.push(["describe", args, block])
end
|
25
26
27
|
# File 'lib/inspec/describe_base.rb', line 25
def input(input_name, options = {})
input_with_profile_id(__profile_id, input_name, options)
end
|
#one(&block) ⇒ nil
Evaluate the given block and collect all checks. These will be registered with the callback function under the ‘describe.one’ name.
18
19
20
21
22
23
|
# File 'lib/inspec/describe_base.rb', line 18
def one(&block)
return unless block_given?
instance_eval(&block)
@action.call("describe.one", @checks, nil)
end
|