- Timestamp:
- Jul 9, 2020, 8:51:43 AM (4 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-2.1.1
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-object-ext/mrblib/object.rb
r321 r439 1 class Object 1 module Kernel 2 # call-seq: 3 # obj.yield_self {|_obj|...} -> an_object 4 # obj.then {|_obj|...} -> an_object 5 # 6 # Yields <i>obj</i> and returns the result. 7 # 8 # 'my string'.yield_self {|s|s.upcase} #=> "MY STRING" 9 # 10 def yield_self(&block) 11 return to_enum :yield_self unless block 12 block.call(self) 13 end 14 alias then yield_self 15 2 16 ## 3 17 # call-seq:
Note:
See TracChangeset
for help on using the changeset viewer.