Skip to content

Instantly share code, notes, and snippets.

@cronin101
Created September 2, 2013 23:24
Show Gist options
  • Select an option

  • Save cronin101/6418143 to your computer and use it in GitHub Desktop.

Select an option

Save cronin101/6418143 to your computer and use it in GitHub Desktop.
You only qux once
main ⭔ define_method :qux_it!, ->{ ->{ define_method :qux_it!, ->{ raise "Already quxxed it bro" } }.() && "Quxxing the foo-bar" }
#=> #<Proc:0x007fb75035b1f0@(pry):24 (lambda)>
main ⭔ qux_it!
#=> "Quxxing the foo-bar"
main ⭔ qux_it!
#RuntimeError: Already quxxed it bro
#from (pry):24:in `block (3 levels) in __pry__'
main ⭔ qux_it!
#RuntimeError: Already quxxed it bro
#from (pry):24:in `block (3 levels) in __pry__'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment