-
-
Save xaviervia/3293959 to your computer and use it in GitHub Desktop.
History
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
# Hooks in DSL | |
En base a RCapture # NOT. Rcapture is poorly planned | |
trigger | hook | |
trigger | fire | filter | |
> hook | trap | lock | |
event | capture (formal) |
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
# From String method pattern - Reader pattern with discovery Method | |
In Ruby, #from_s: | |
- The instance of the class example (Klass) has a member called @from_regexp | |
- The #from_s method is both a class method and an instance method: | |
- When instance, loads the data into the object | |
- When class, returns a new instance loaded with the data | |
- #from_s raises an ArgumentError when the input does not match the @from_regexp pattern |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment