Skip to content

Instantly share code, notes, and snippets.

@rickychilcott
Last active October 11, 2018 15:54
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 rickychilcott/2b294420d95b2d828d5963fe6a8e2141 to your computer and use it in GitHub Desktop.
Save rickychilcott/2b294420d95b2d828d5963fe6a8e2141 to your computer and use it in GitHub Desktop.
macro uniquify_builder(attribute_name, type, *attrs)
def self.unique_{{attribute_name}}({% unless attrs.empty? %}{{attrs}},{% end %} max_retries = 10_0000)
p "{{attribute_name}}"
p "{{attrs}}"
end
end
def test_1()
"test_1"
end
uniquify_builder(test_1, String)
def test_2(name = "something")
"test_2 #{name}"
end
uniquify_builder(test_2, String, name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment