Module: Aldebaran::Delegator
- Defined in:
- lib/aldebaran/base.rb
Overview
aldebaran delegation mixin. Mixing this module into an object causes all methods to be delegated to the aldebaran::Application class. Used primarily at the top-level.
Class Attribute Summary collapse
-
.target ⇒ Object
Returns the value of attribute target.
Class Method Summary collapse
-
.delegate(*methods) ⇒ Object
:nodoc:.
Class Attribute Details
.target ⇒ Object
Returns the value of attribute target.
1572 1573 1574 |
# File 'lib/aldebaran/base.rb', line 1572 def target @target end |
Class Method Details
.delegate(*methods) ⇒ Object
:nodoc:
1556 1557 1558 1559 1560 1561 1562 1563 1564 |
# File 'lib/aldebaran/base.rb', line 1556 def self.delegate(*methods) methods.each do |method_name| define_method(method_name) do |*args, &block| return super(*args, &block) if respond_to? method_name Delegator.target.send(method_name, *args, &block) end private method_name end end |