Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
class MyClassDynamic
DEFAULT_METHOD_NAME = :my_dynamic_method
def initialize(method_name = nil)
method_name = DEFAULT_METHOD_NAME unless method_name
method_definition = Proc.new { method_name.to_s }
self.class.send(:define_method, method_name, method_definition)
end
end