-
-
Save rick/2dfd402d598113ef9729 to your computer and use it in GitHub Desktop.
Come for the `set -e`, stay for the `|| true`
This file contains 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
>> class Object | |
>> def set(other) | |
>> other | |
>> end | |
>> | |
?> def e | |
>> Hero.new | |
>> end | |
>> end | |
=> :e | |
>> | |
?> class Hero | |
>> def -@() | |
>> puts "PRODUCTION HERO SAFETY LEVEL ENGAGE!" | |
>> end | |
>> end | |
=> :-@ | |
>> set -e | |
PRODUCTION HERO SAFETY LEVEL ENGAGE! | |
=> nil | |
>> class Hero | |
>> def +@() | |
>> puts "DISENGAGED. FIGHT STRONG, HERO." | |
>> end | |
>> end | |
=> :+@ | |
>> set +e | |
DISENGAGED. FIGHT STRONG, HERO. | |
=> nil | |
>> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment