Skip to content

Instantly share code, notes, and snippets.

@granolocks
Last active January 31, 2017 18:36
Show Gist options
  • Select an option

  • Save granolocks/9c7d7b19eda26e830f553b03d70d7339 to your computer and use it in GitHub Desktop.

Select an option

Save granolocks/9c7d7b19eda26e830f553b03d70d7339 to your computer and use it in GitHub Desktop.
pray your conditions are met, otherwise take a look
require 'pry'
class Binding
def pray(expected_condition)
unless eval(expected_condition)
puts 'prayers unanswered, mortal'
pry
end
end
end
a = 2
b = 2
# wont hit
binding.pray('a + b == 4')
# hits
binding.pray('a + b == 5')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment