3 $Release Version: 1.1 $
5 Original version by Tosh
11 A Module to define delegations for selected methods to a class.
15 Using through extending the class.
20 def_delegators("@out", "printf", "print")
21 def_delegators(:@in, :gets)
22 def_delegator(:@contents, :[], "content_at")
31 --- Forwardable#def_instance_delegators(accessor, *methods)
33 adding the delegations for each method of ((|methods|)) to
36 --- Forwardable#def_instance_delegator(accessor, method, ali = method)
38 adding the delegation for ((|method|)) to ((|accessor|)). When
39 you give optional argument ((|ali|)), ((|ali|)) is used as the
40 name of the delegation method, instead of ((|method|)).
42 --- Forwardable#def_delegators(accessor, *methods)
44 the alias of ((|Forwardable#def_instance_delegators|)).
46 --- Forwardable#def_delegator(accessor, method, ali = method)
48 the alias of ((|Forwardable#def_instance_delegator|)).
52 a Module to define delegations for selected methods to an object.
56 Using through extending the object.
59 g.extend SingleForwardable
60 g.def_delegator("@out", :puts)
65 --- SingleForwardable#def_singleton_delegators(accessor, *methods)
67 adding the delegations for each method of ((|methods|)) to
70 --- SingleForwardable#def_singleton_delegator(accessor, method, ali = method)
72 adding the delegation for ((|method|)) to ((|accessor|)). When
73 you give optional argument ((|ali|)), ((|ali|)) is used as the
74 name of the delegation method, instead of ((|method|)).
76 --- SingleForwardable#def_delegators(accessor, *methods)
78 the alias of ((|SingleForwardable#def_instance_delegators|)).
80 --- SingleForwardable#def_delegator(accessor, method, ali = method)
82 the alias of ((|SingleForwardable#def_instance_delegator|)).