Module: ModuleCluster::Define::Block::Subclass
- Extended by:
- Module, ExtendForCascade::Subclass
- Included in:
- ClassOrSubclass, ModuleOrSubclass
- Defined in:
- lib/module-cluster/ModuleCluster/Define/Block/Subclass.rb
Class Method Summary collapse
-
.should_run_block?(hooked_instance) ⇒ Boolean
self.should_run_block? #.
Instance Method Summary collapse
-
#subclass(&runtime_block) ⇒ Object
subclass #.
Methods included from Module
module_extend, module_include, module_include_or_extend, prepend_module_extend, prepend_module_include, prepend_module_include_or_extend
Methods included from ExtendForCascade
Methods included from Suspend::WithoutHooks
#without_any_extend_hooks, #without_any_hooks, #without_any_include_hooks, #without_extend_hooks, #without_include_hooks, #without_prepend_extend_hooks, #without_prepend_include_hooks
Methods included from Suspend::Hooks
#all_extend_hooks_suspended?, #all_hooks_suspended?, #all_include_hooks_suspended?, #extend_hooks_suspended?, #hooks_suspended?, #include_hooks_suspended?, #prepend_extend_hooks_suspended?, #prepend_include_hooks_suspended?, #resume_any_extend_hooks, #resume_any_hooks, #resume_any_include_hooks, #resume_extend_hooks, #resume_include_hooks, #resume_prepend_extend_hooks, #resume_prepend_include_hooks, #suspend_any_extend_hooks, #suspend_any_hooks, #suspend_any_include_hooks, #suspend_extend_hooks, #suspend_include_hooks, #suspend_prepend_extend_hooks, #suspend_prepend_include_hooks
Methods included from CascadeFeatures::ClusterStack
#cluster_stack, cluster_stack, cluster_stacks
Methods included from ExtendForCascade::Subclass
Class Method Details
.should_run_block?(hooked_instance) ⇒ Boolean
self.should_run_block? #
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/module-cluster/ModuleCluster/Define/Block/Subclass.rb', line 22 def self.should_run_block?( hooked_instance ) should_run_block = false if hooked_instance.is_a?( Module ) if hooked_instance.is_a?( Class ) # subclass instance if hooked_instance.ancestors[ 1 ].is_a?( Class ) should_run_block = true end # class instance - don't run end # module instance - don't run end return should_run_block end |
Instance Method Details
#subclass(&runtime_block) ⇒ Object
subclass #
48 49 50 |
# File 'lib/module-cluster/ModuleCluster/Define/Block/Subclass.rb', line 48 def subclass( & runtime_block ) return cluster_stack.subclass( ModuleCluster::Define::Block::Subclass, runtime_block ) end |