-
-
Save paulcsmith/7f4cc5f5b34c7b6410395bc8bda81920 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
macro inherited | |
def call_action(action_name) | |
case action_name | |
\{% for method in @type.methods.map(&.name) %} | |
when :\{{method.id}} | |
\{{method.id}} | |
\{% end %} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think is a parser error not allowing {% for %} inside
case
... what do you think of reporting it?Here's a workaround:
I don't recomend you using
macro inherited
tho. For things with@type
, in my opinion,macro def
s are better (just because is more clear code)