module Toys::Mixin::ModuleMethods
Methods that will be added to a mixin module object.
Attributes
The inclusion proc for this mixin. This block is evaluated in the tool class immediately after the mixin is included, and is passed any arguments provided to the `include` directive.
@return [Proc] The inclusion procedure for this mixin.
The initializer proc for this mixin. This proc is evaluated in the runtime context before execution, and is passed any arguments provided to the `include` directive. It can perform any runtime initialization needed by the mixin.
@return [Proc] The iniitiliazer for this mixin.
Public Instance Methods
Set an inclusion proc for this mixin. This block is evaluated in the tool class immediately after the mixin is included, and is passed any arguments provided to the `include` directive.
@param block [Proc] Sets the inclusion proc. @return [self]
# File lib/toys/mixin.rb, line 137 def on_include(&block) self.inclusion = block self end
Set the initializer for this mixin. This block is evaluated in the runtime context before execution, and is passed any arguments provided to the `include` directive. It can perform any runtime initialization needed by the mixin.
@param block [Proc] Sets the initializer proc. @return [self]
# File lib/toys/mixin.rb, line 114 def on_initialize(&block) self.initializer = block self end