Method: Inspec::Rule#initialize

Defined in:
lib/inspec/rule.rb

#initialize(id, _opts, &block) ⇒ Rule



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/inspec/rule.rb', line 15

def initialize(id, _opts, &block)
  @id = id
  @impact = nil
  @__block = block
  @__code = __get_block_source(&block)
  @__source_location = __get_block_source_location(&block)
  @title = nil
  @desc = nil
  # not changeable by the user:
  @profile_id = nil
  @checks = []
  # evaluate the given definition
  instance_eval(&block) if block_given?
end