Module: Module::Cluster::Cluster::ClusterInterface
- Included in:
- Module::Cluster::Cluster
- Defined in:
- lib/module/cluster/cluster/cluster_interface.rb
Overview
Interface implemenation for ModuleCluster::Cluster::Cluster.
Declared separately so that methods can be easily overridden.
Instance Attribute Summary collapse
-
#Cluster name.(name.) ⇒ String
readonly
Name of cluster.
-
#instance ⇒ Object
readonly
Instance for which cluster is operative.
-
#Instance. ⇒ Object
readonly
Instance for which cluster is operative.
-
#name ⇒ String
readonly
Name of cluster.
Instance Method Summary collapse
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::HookController::ChainProxy
Create after-extend event hook.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy
(also: #after_subclass_or_extend)
Create after-extend and subclass event hooks.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::HookController::ChainProxy
Create after-include event hook.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy
(also: #after_extend_or_include)
Create after-include and after-extend event hooks.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy
(also: #after_include_or_subclass_or_extend, #after_extend_or_include_or_subclass, #after_extend_or_subclass_or_include, #after_subclass_or_include_or_extend, #after_subclass_or_extend_or_include)
Create after-include and after-extend and subclass event hooks.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy
(also: #after_subclass_or_include)
Create after-include and subclass event hooks.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::HookController::ChainProxy
Create before-extend event hook.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy
(also: #before_subclass_or_extend)
Create before-extend and subclass event hooks.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::HookController::ChainProxy
Create before-include event hook.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy
(also: #before_extend_or_include)
Create before-include and before-extend event hooks.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy
(also: #before_include_or_subclass_or_extend, #before_extend_or_include_or_subclass, #before_extend_or_subclass_or_include, #before_subclass_or_include_or_extend, #before_subclass_or_extend_or_include)
Create before-include and before-extend and subclass event hooks.
-
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy
(also: #before_subclass_or_include)
Create before-include and subclass event hooks.
-
#disable ⇒ Object
(also: #suspend)
Disable cluster.
-
#disabled? ⇒ true, false
(also: #suspended?)
Query whether cluster is disabled.
-
#enable ⇒ Object
Re-enable cluster.
-
#enabled? ⇒ true, false
Query whether cluster is enabled.
- #initialize(instance, name) ⇒ Object
-
#subclass ⇒ Module::Cluster::InstanceController::HookController::ChainProxy
Create subclass event hook.
Instance Attribute Details
#Cluster name.(name.) ⇒ String (readonly)
Name of cluster.
39 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 39 attr_reader :name |
#instance ⇒ Object (readonly)
Instance for which cluster is operative.
550 551 552 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 550 def instance @instance end |
#Instance. ⇒ Object (readonly)
Instance for which cluster is operative.
550 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 550 attr_reader :instance |
#name ⇒ String (readonly)
Name of cluster.
39 40 41 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 39 def name @name end |
Instance Method Details
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::HookController::ChainProxy
Create after-extend event hook.
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 211 def after_extend( *contexts, & block ) hook_controller = @instance_controller.after_extend_controller chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy Also known as: after_subclass_or_extend
Create after-extend and subclass event hooks.
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 430 def after_extend_or_subclass( *contexts, & block ) hook_controller = @instance_controller.after_extend_subclass_proxy chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::HookController::ChainProxy
Create after-include event hook.
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 153 def after_include( *contexts, & block ) hook_controller = @instance_controller.after_include_controller chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy Also known as: after_extend_or_include
Create after-include and after-extend event hooks.
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 302 def after_include_or_extend( *contexts, & block ) hook_controller = @instance_controller.after_include_extend_proxy chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy Also known as: after_include_or_subclass_or_extend, after_extend_or_include_or_subclass, after_extend_or_subclass_or_include, after_subclass_or_include_or_extend, after_subclass_or_extend_or_include
Create after-include and after-extend and subclass event hooks.
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 506 def after_include_or_extend_or_subclass( *contexts, & block ) hook_controller = @instance_controller.after_include_extend_subclass_proxy chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy Also known as: after_subclass_or_include
Create after-include and subclass event hooks.
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 366 def after_include_or_subclass( *contexts, & block ) hook_controller = @instance_controller.after_include_subclass_proxy chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::HookController::ChainProxy
Create before-extend event hook.
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 182 def before_extend( *contexts, & block ) hook_controller = @instance_controller.before_extend_controller chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy Also known as: before_subclass_or_extend
Create before-extend and subclass event hooks.
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 398 def before_extend_or_subclass( *contexts, & block ) hook_controller = @instance_controller.before_extend_subclass_proxy chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::HookController::ChainProxy
Create before-include event hook.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 124 def before_include( *contexts, & block ) hook_controller = @instance_controller.before_include_controller chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy Also known as: before_extend_or_include
Create before-include and before-extend event hooks.
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 270 def before_include_or_extend( *contexts, & block ) hook_controller = @instance_controller.before_include_extend_proxy chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy Also known as: before_include_or_subclass_or_extend, before_extend_or_include_or_subclass, before_extend_or_subclass_or_include, before_subclass_or_include_or_extend, before_subclass_or_extend_or_include
Create before-include and before-extend and subclass event hooks.
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 466 def before_include_or_extend_or_subclass( *contexts, & block ) hook_controller = @instance_controller.before_include_extend_subclass_proxy chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#before_include(context, ...) ⇒ Module::Cluster::InstanceController::MultipleHookControllerProxy::ChainProxy Also known as: before_subclass_or_include
Create before-include and subclass event hooks.
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 334 def before_include_or_subclass( *contexts, & block ) hook_controller = @instance_controller.before_include_subclass_proxy chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ).context( *contexts ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |
#disable ⇒ Object Also known as: suspend
Disable cluster.
84 85 86 87 88 89 90 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 84 def disable @enabled = false return self end |
#disabled? ⇒ true, false Also known as: suspended?
Query whether cluster is disabled.
66 67 68 69 70 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 66 def disabled? return ! @enabled end |
#enable ⇒ Object
Re-enable cluster.
103 104 105 106 107 108 109 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 103 def enable @enabled = true return self end |
#enabled? ⇒ true, false
Query whether cluster is enabled.
50 51 52 53 54 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 50 def enabled? return @enabled end |
#initialize(instance, name) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 18 def initialize( instance, name ) @instance = instance @instance_controller = ::Module::Cluster.instance_controller( instance ) @name = name @enabled = true end |
#subclass ⇒ Module::Cluster::InstanceController::HookController::ChainProxy
Create subclass event hook.
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/module/cluster/cluster/cluster_interface.rb', line 238 def subclass( *contexts, & block ) # contexts parameter included for compatibility with multiple-hook-controller proxy hook_controller = @instance_controller.subclass_controller chain_proxy_instance = hook_controller.chain_proxy chain_proxy_instance.cluster_name( @name ) if block_given? chain_proxy_instance.action( & block ) end return chain_proxy_instance end |