def using (*args) yield *args end
For (a rather half-assed) example:
>> using [10,20,30], 40 do |x,y| >> x << y if y.is_a? Fixnum >> puts x.to_s >> end 10203040 => nil
11319 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
def using (*args) yield *args end
>> using [10,20,30], 40 do |x,y| >> x << y if y.is_a? Fixnum >> puts x.to_s >> end 10203040 => nil
You need to create an account or log in to post comments to this site.
The error checking is done automatically, and the &block argument is unnecessary when using yield.