Module: Aleph::Delegator
- Defined in:
- lib/angstrom.rb
Overview
thank you sinatra! Sinatra delegation mixin. Mixing this module into an object causes all methods to be delegated to the Aleph::Angstrom class. Used primarily at the top-level.
Class Attribute Summary collapse
-
.target ⇒ Object
Returns the value of attribute target.
Class Method Summary collapse
Class Attribute Details
.target ⇒ Object
Returns the value of attribute target.
119 120 121 |
# File 'lib/angstrom.rb', line 119 def target @target end |
Class Method Details
.delegate(*methods) ⇒ Object
106 107 108 109 110 111 112 113 114 |
# File 'lib/angstrom.rb', line 106 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 |