Method: Inspec::ProfileContext#subcontext_by_name

Defined in:
lib/inspec/profile_context.rb

#subcontext_by_name(name) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/inspec/profile_context.rb', line 84

def subcontext_by_name(name)
  found = @lib_subcontexts.find { |c| c.profile_id == name }
  if !found
    @lib_subcontexts.each do |c|
      found = c.subcontext_by_name(name)
      break if found
    end
  end

  found
end