Last active
January 31, 2017 18:36
-
-
Save granolocks/9c7d7b19eda26e830f553b03d70d7339 to your computer and use it in GitHub Desktop.
pray your conditions are met, otherwise take a look
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 '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