File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change
1
+ Thu Jan 3 14:58:00 2013 Zachary Scott <zachary@zacharyscott.net>
2
+
3
+ * lib/forwardable.rb (SingleForwardable): Fix example in overview
4
+ Patch by Vladimir Andrijevik [Github Fixes #231]
5
+
1
6
Thu Jan 3 14:32:47 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
2
7
3
8
* configure.in (OBJCOPY): Fixes build error for NativeClient.
Original file line number Diff line number Diff line change @@ -196,17 +196,21 @@ def #{ali}(*args, &block)
196
196
# printer.def_delegator "STDOUT", "puts" # add delegation for STDOUT.puts()
197
197
# printer.puts "Howdy!"
198
198
#
199
- # Also, SingleForwardable can be use to Class or Module.
199
+ # Also, SingleForwardable can be used to set up delegation for a Class or Module.
200
200
#
201
- # module Facade
202
- # extend SingleForwardable
203
- # def_delegator :Implementation, :service
204
- #
205
- # class Implementation
206
- # def service...
207
- # end
208
- # end
201
+ # class Implementation
202
+ # def self.service
203
+ # puts "serviced!"
204
+ # end
205
+ # end
206
+ #
207
+ # module Facade
208
+ # extend SingleForwardable
209
+ # def_delegator :Implementation, :service
210
+ # end
209
211
#
212
+ # Facade.service #=> serviced!
213
+ #
210
214
# If you want to use both Forwardable and SingleForwardable, you can
211
215
# use methods def_instance_delegator and def_single_delegator, etc.
212
216
module SingleForwardable
You can’t perform that action at this time.
0 commit comments