jameskilton (owner)

Revisions

gist: 210999 Download_button fork
public
Public Clone URL: git://gist.github.com/210999.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Normal
def method
  ret_val = "something"
 
  do_this_thing if ret_val == "something"
 
  ret_val
end
 
# Or with #tap
def method
  ret_val = "something"
 
  ret_val.tap {|v| do_this_thing if v } # still returns ret_val
end