Skip to content

Instantly share code, notes, and snippets.

@zatherz
Created August 16, 2017 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zatherz/cc0c377f8d759e842f88276e14797a3a to your computer and use it in GitHub Desktop.
Save zatherz/cc0c377f8d759e842f88276e14797a3a to your computer and use it in GitHub Desktop.
{% begin %}
macro def_converter(name)
\{% class_name = "Test".id %}
MagicJSON.conv_name_to_class_path :class_name, \{{name}}
module \{{class_name}}
\{{ yield }}
extend self
end
\{% CONVERTERS[":#{name.id}".id] = class_name.stringify %}
end
{% end %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment