Skip to content

Instantly share code, notes, and snippets.

@xaviervia
Created August 8, 2012 10:05
Show Gist options
  • Save xaviervia/3293959 to your computer and use it in GitHub Desktop.
Save xaviervia/3293959 to your computer and use it in GitHub Desktop.
History
# Hooks in DSL
En base a RCapture # NOT. Rcapture is poorly planned
trigger | hook
trigger | fire | filter
> hook | trap | lock
event | capture (formal)
# 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