Class: Symbiont::PublicTrigger Private
- Defined in:
- lib/symbiont/public_trigger.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 trigger that considers only public methods of executable contexts during method dispatching.
Constant Summary
Constants inherited from Trigger
Trigger::ContextNoMethodError, Trigger::IKO, Trigger::IOK, Trigger::IncompatibleContextDirectionError, Trigger::KIO, Trigger::KOI, Trigger::OIK, Trigger::OKI, Trigger::UnprovidedClosureAttributeError
Instance Attribute Summary
Attributes inherited from Trigger
#__closure__, #__context_direction__, #__inner_contexts__, #__kernel_context__, #__outer_context__
Instance Method Summary collapse
-
#__actual_context__(method_name) ⇒ Objcet
private
Returns the first context that is able to respond to the required method.
Methods inherited from Trigger
#__directed_contexts__, #__evaluate__, #initialize, #method, #method_missing, #respond_to_missing?
Constructor Details
This class inherits a constructor from Symbiont::Trigger
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Symbiont::Trigger
Instance Method Details
#__actual_context__(method_name) ⇒ Objcet
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 the first context that is able to respond to the required method. The context is chosen in the context direction order (see #context_direction). Raises NoMethodError excepition when no one of the contexts are able to respond to the required method. Basicaly (in #super), abstract implementation raises NoMethodError.
27 28 29 30 31 |
# File 'lib/symbiont/public_trigger.rb', line 27 def __actual_context__(method_name) __directed_contexts__.find do |context| context.respond_to?(method_name, false) end || super end |