Class: Chef::RunContext::ChildRunContext Private

Inherits:
Chef::RunContext show all
Extended by:
Forwardable
Defined in:
lib/chef/run_context.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A child run context. Delegates all root context calls to its parent.

Constant Summary collapse

CHILD_STATE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

%w{
  add_delayed_action
  before_notification_collection
  before_notifications
  create_child
  delayed_actions
  delayed_notification_collection
  delayed_notification_collection=
  delayed_notifications
  immediate_notification_collection
  immediate_notification_collection=
  immediate_notifications
  include_recipe
  initialize_child_state
  load_recipe
  load_recipe_file
  notifies_before
  notifies_delayed
  notifies_immediately
  parent_run_context
  resource_collection
  resource_collection=
  reverse_immediate_notifications
  root_run_context
  runner
  runner=
  unified_mode
  updated_resources
}.map(&:to_sym)

Instance Attribute Summary

Attributes inherited from Chef::RunContext

#action_collection, #before_notification_collection, #cookbook_collection, #default_secret_config, #default_secret_service, #definitions, #delayed_actions, #delayed_notification_collection, #events, #immediate_notification_collection, #input_collection, #logger, #node, #parent_run_context, #profile_collection, #reboot_info, #resource_collection, #rest, #rest_clean, #runner, #updated_resources, #waiver_collection

Instance Method Summary collapse

Methods inherited from Chef::RunContext

#add_delayed_action, #before_notifications, #cancel_reboot, #create_child, #delayed_notifications, #has_cookbook_file_in_cookbook?, #has_template_in_cookbook?, #immediate_notifications, #include_recipe, #initialize_child_state, #load, #load_recipe, #load_recipe_file, #loaded_attribute, #loaded_attributes, #loaded_fully_qualified_attribute?, #loaded_fully_qualified_recipe?, #loaded_recipe, #loaded_recipe?, #loaded_recipes, #notifies_before, #notifies_delayed, #notifies_immediately, #open_stream, #reboot_requested?, #request_reboot, #resolve_attribute, #reverse_immediate_notifications, #root_run_context, #transport, #transport_connection, #unreachable_cookbook?

Constructor Details

#initialize(parent_run_context) ⇒ ChildRunContext

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ChildRunContext.



751
752
753
754
755
756
757
758
# File 'lib/chef/run_context.rb', line 751

def initialize(parent_run_context)
  @parent_run_context = parent_run_context

  # We don't call super, because we don't bother initializing stuff we're
  # going to delegate to the parent anyway.  Just initialize things that
  # every instance needs.
  initialize_child_state
end