Last active
November 10, 2017 21:44
-
-
Save kaungst/5354fddebe4643fbd493902988770fb1 to your computer and use it in GitHub Desktop.
Cool irb feature in ruby 2.4+
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 'irb' | |
class TroublesomeClass | |
def method_making_a_fuss(bad_argument) | |
return if bad_argument == false | |
binding.irb # you enter a repl where you can `puts bad_argument` | |
end | |
end | |
TroublesomeClass.method_making_a_fuss('yolo') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment