Created
March 5, 2019 12:11
-
-
Save lwakefield/a5c0dffcf5b76b4aa304a68fa020fd0e to your computer and use it in GitHub Desktop.
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
class Node | |
end | |
class FooNode < Node | |
end | |
class BarNode < Node | |
end | |
class Parser | |
@foo = "" | |
def method_names | |
{{ | |
@type.methods.map do |v| | |
v.name.stringify + ":" + (v.args.map &.restriction.stringify).join(",") | |
end | |
}} | |
end | |
def transform(node : FooNode) | |
end | |
def transform(node : BarNode) | |
end | |
end | |
parser = Parser.new | |
parser.method_names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment