-
-
Save rdammkoehler/718112d21d4bd68500f347e18c478fa7 to your computer and use it in GitHub Desktop.
return chain with gimme in ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'gimme' | |
| class C | |
| def f | |
| return 1 | |
| end | |
| end | |
| l = [ 2, 3, 4, 5 ] | |
| c = gimme(C) | |
| give(c).f() { l.pop } | |
| 4.times { | |
| puts c.f | |
| } | |
| # /Users/rich/.rvm/rubies/ruby-2.2.3/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/rich/projects/HISC/DC_ClearCare_Collector_rb/x.rb | |
| # 5 | |
| # 4 | |
| # 3 | |
| # 2 | |
| # | |
| # Process finished with exit code 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment