Module: Agrippa::Delegation::ClassMethods
- Defined in:
- lib/agrippa/delegation.rb
Instance Method Summary collapse
- #class_delegate(*methods) ⇒ Object
- #delegate(*methods) ⇒ Object
- #delegate_command(*methods) ⇒ Object
Instance Method Details
#class_delegate(*methods) ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/agrippa/delegation.rb', line 48 def class_delegate(*methods) ::Agrippa::Delegation.build(self, caller, methods, <<-END) def self.NAME(*args, &block) TARGET.METHOD(*args, &block) end END self end |
#delegate(*methods) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/agrippa/delegation.rb', line 39 def delegate(*methods) ::Agrippa::Delegation.build(self, caller, methods, <<-END) def NAME(*args, &block) TARGET.METHOD(*args, &block) end END self end |
#delegate_command(*methods) ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/agrippa/delegation.rb', line 57 def delegate_command(*methods) ::Agrippa::Delegation.build(self, caller, methods, <<-END) def NAME(*args, &block) store('TARGET', TARGET.METHOD(*args, &block)) end END self end |