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{
  create_child
  add_delayed_action
  delayed_actions
  delayed_notification_collection
  delayed_notification_collection=
  delayed_notifications
  immediate_notification_collection
  immediate_notification_collection=
  immediate_notifications
  before_notification_collection
  before_notifications
  include_recipe
  initialize_child_state
  load_recipe
  load_recipe_file
  notifies_before
  notifies_immediately
  notifies_delayed
  parent_run_context
  root_run_context
  resource_collection
  resource_collection=
  runner
  runner=
}.map { |x| x.to_sym }

Instance Attribute Summary

Attributes inherited from Chef::RunContext

#action_collection, #before_notification_collection, #cookbook_collection, #definitions, #delayed_actions, #delayed_notification_collection, #events, #immediate_notification_collection, #logger, #node, #parent_run_context, #reboot_info, #resource_collection, #rest, #rest_clean, #runner

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, #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



674
675
676
677
678
679
680
681
# File 'lib/chef/run_context.rb', line 674

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