Method: Inspec::ProfileContext#initialize

Defined in:
lib/inspec/profile_context.rb

#initialize(profile_id, backend, profile_registry = {}, only_ifs = []) ⇒ ProfileContext

Returns a new instance of ProfileContext.



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/inspec/profile_context.rb', line 13

def initialize(profile_id, backend, profile_registry = {}, only_ifs = [])
  if backend.nil?
    fail 'ProfileContext is initiated with a backend == nil. ' \
         'This is a backend error which must be fixed upstream.'
  end

  @profile_id = profile_id
  @rules = profile_registry
  @only_ifs = only_ifs
  @backend = backend

  reload_dsl
end