Class: Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb

Overview

A MultipleHookControllerProxy uses a MultipleHookControllerProxy::ChainProxy

to chain commands that rely on chained state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent_multiple_hook_controller_proxy) ⇒ ChainProxy

Returns a new instance of ChainProxy.

Parameters:

  • parent_multiple_hook_controller_proxy

    Multiple Hook Controller Proxy for which this Chain Proxy is operative.



17
18
19
20
21
22
23
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 17

def initialize( parent_multiple_hook_controller_proxy )

  @parent_multiple_hook_controller_proxy = parent_multiple_hook_controller_proxy
  
  @proxies = @parent_multiple_hook_controller_proxy.hook_controllers.collect( & :chain_proxy )
  
end

Instance Attribute Details

#Multiple Hook Controller Proxy for which this instance is operative as a chaining proxy(HookControllerProxy) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy (readonly)

Returns Parent Multiple Hook Controller Proxy.

Returns:



406
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 406

attr_reader :parent_multiple_hook_controller_proxy

#parent_multiple_hook_controller_proxyModule::Cluster::InstanceController::MultipleHookControllerProxy (readonly)

Returns Parent Multiple Hook Controller Proxy.

Returns:



406
407
408
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 406

def parent_multiple_hook_controller_proxy
  @parent_multiple_hook_controller_proxy
end

#proxiesArray<Module::Cluster::InstanceController::HookController::ChainProxy> (readonly)



419
420
421
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 419

def proxies
  @proxies
end

#Proxies for which this instance is operative as a chaining proxy.Array<Module::Cluster::InstanceController::HookController::ChainProxy> (readonly)



419
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 419

attr_reader :proxies

Instance Method Details

#action {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy

Declare that action should be performed at event hook in the context

specified this chained declaration.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



149
150
151
152
153
154
155
156
157
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 149

def action( & block )
  
  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.action( & block )
  end
  
  return self
  
end

#before_extend {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::HookController::ChainProxy

Declare that chained actions should be inserted into the event stack after the location

in the same event stack where provided module(s) are specified to be extended.

Parameters:

  • module

    Module that insert should be after.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



322
323
324
325
326
327
328
329
330
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 322

def after_extend( *modules, & block )

  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.after_extend( *modules, & block )
  end
  
  return self
  
end

#before_include {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::HookController::ChainProxy

Declare that chained actions should be inserted into the event stack after the location

in the same event stack where provided module(s) are specified to be included.

Parameters:

  • module

    Module that insert should be after.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



294
295
296
297
298
299
300
301
302
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 294

def after_include( *modules, & block )

  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.after_include( *modules, & block )
  end
  
  return self
  
end

#before_include_or_extend {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::HookController::ChainProxy Also known as: after_extend_or_include

Declare that chained actions should be inserted into the event stack after the location

in the same event stack where provided module(s) are specified to be included or extended.

Parameters:

  • module

    Module that insert should be after.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



351
352
353
354
355
356
357
358
359
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 351

def after_include_or_extend( *modules, & block )
  
  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.after_include_or_extend( *modules, & block )
  end
  
  return self
  
end

#before_extend {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::HookController::ChainProxy

Declare that chained actions should be inserted into the event stack prior to the location

in the same event stack where provided module(s) are specified to be extended.

Parameters:

  • module

    Module that insert should be prior to.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



207
208
209
210
211
212
213
214
215
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 207

def before_extend( *modules, & block )
  
  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.before_extend( *modules, & block )
  end
  
  return self
  
end

#before_include {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::HookController::ChainProxy

Declare that chained actions should be inserted into the event stack prior to the location

in the same event stack where provided module(s) are specified to be included.

Parameters:

  • module

    Module that insert should be prior to.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



235
236
237
238
239
240
241
242
243
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 235

def before_include( *modules, & block )
  
  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.before_include( *modules, & block )
  end
  
  return self
  
end

#before_include_or_extend {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::HookController::ChainProxy Also known as: before_extend_or_include

Declare that chained actions should be inserted into the event stack prior to the location

in the same event stack where provided module(s) are specified to be included or extended.

Parameters:

  • module

    Module that insert should be prior to.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



264
265
266
267
268
269
270
271
272
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 264

def before_include_or_extend( *modules, & block )

  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.before_include_or_extend( *modules, & block )
  end
  
  return self
  
end

#cascade(context, ...) {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy Also known as: cascade_to

Declare contexts to which declarations made from this declaration chain should cascade.

Parameters:

  • context

    nil, :any, :class, :module, :subclass Contexts that should have event hooks cascaded into them.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



177
178
179
180
181
182
183
184
185
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 177

def cascade( *cascade_contexts, & block )
  
  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.cascade( *cascade_contexts, & block )
  end
  
  return self
  
end

#cluster_name(cluster_name) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy

Set cluster name for which chained actions will be inserted in stack.



432
433
434
435
436
437
438
439
440
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 432

def cluster_name( cluster_name )
  
  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.cluster_name( cluster_name )
  end
  
  return self
  
end

#context(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy

Set index where chained actions will be inserted in stack.

Parameters:

  • context

    nil, :any, :class, :module, :subclass Contexts that should have event hooks cascaded into them.

Returns:



376
377
378
379
380
381
382
383
384
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 376

def context( *contexts )
  
  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.context( *contexts )
  end
  
  return self
  
end

#extend {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy

Declare that modules should be extended at event hook in the context specified this chained declaration.

Parameters:

  • module

    Module to extend at event hook in the context specified this chained declaration.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



69
70
71
72
73
74
75
76
77
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 69

def extend( *modules, & block )

  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.extend( *modules, & block )
  end

  return self

end

#extend_and_include {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy

Declare that modules should be extended and included at event hook in the context

specified this chained declaration. Order is reversed from #include_and_extend.

Parameters:

  • module

    Module to extend and include at event hook in the context specified this chained declaration.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



125
126
127
128
129
130
131
132
133
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 125

def extend_and_include( *modules, & block )
  
  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.extend_and_include( *modules, & block )
  end

  return self
  
end

#include {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy

Declare that modules should be included at event hook in the context specified this chained declaration.

Parameters:

  • module

    Module to include at event hook in the context specified this chained declaration.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



42
43
44
45
46
47
48
49
50
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 42

def include( *modules )
  
  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.include( *modules )
  end

  return self
  
end

#include_and_extend {|hooked_instance| ... } ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy

Declare that modules should be included and extended at event hook in the context

specified this chained declaration. See also #extend_and_include.

Parameters:

  • module

    Module to include and extend at event hook in the context specified this chained declaration.

Yields:

  • (hooked_instance)

    Block for event hook action.

Yield Parameters:

  • hooked_instance

    Instance for which event hook is occurring. Equivalent to parameter for #included and #extended.

Returns:



97
98
99
100
101
102
103
104
105
# File 'lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb', line 97

def include_and_extend( *modules, & block )
  
  @proxies.each do |this_hook_controller_chain_proxy|
    this_hook_controller_chain_proxy.include_and_extend( *modules, & block )
  end

  return self
  
end