Last active
October 11, 2018 15:54
-
-
Save rickychilcott/2b294420d95b2d828d5963fe6a8e2141 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
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