OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/lib/instance_finder.rb

11 lines
233 B

class InstanceFinder
def self.register(model, method)
@model_method_map ||= {}
@model_method_map[model] = method
end
def self.find(model, identifier)
instance = @model_method_map[model].call(identifier)
end
end