-
-
Save havenwood/c1b754cf58f134ac1ce322b484d8363a to your computer and use it in GitHub Desktop.
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
PARSING_ROUTES = [ | |
{meth: :name, regexp: %r{\A\$((::)?(\w+(-\w+)*::)*\w+(-\w+)*(\[.+?\])*)}, first: true}, | |
{meth: :content, regexp: %r{\A'.*?'}m}, | |
# ... | |
] | |
route = PARSING_ROUTES.find { |regexp:| chunk =~ regexp } | |
params = route.slice(:first, :possible_regexp_check).compact | |
public_send(route.fetch(:method), params) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment