Created
April 27, 2016 18:16
-
-
Save duhruh/7478d78d34bb673c1d482a05dc4c88a1 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
def self.my_dynamic_method(lang) | |
class_eval %Q{ | |
def #{lang} | |
# your code here | |
end | |
} | |
end | |
[:english, :french, :gangster].each do |lang| | |
my_dynamic_method lang | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment