Skip to content

Instantly share code, notes, and snippets.

@thiagoa
Last active December 20, 2016 02:09
Show Gist options
  • Save thiagoa/4d71d29a8eb26de383144f1cd78ccd2a to your computer and use it in GitHub Desktop.
Save thiagoa/4d71d29a8eb26de383144f1cd78ccd2a to your computer and use it in GitHub Desktop.
class DynamicModuleGenerator < Module
def initialize(methods)
module_eval do
methods.each do |method|
define_method(method) do
puts "#{method} was defined as an instance method"
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment