Skip to content

Instantly share code, notes, and snippets.

@DGaffney
Created January 21, 2011 00:40
Show Gist options
  • Select an option

  • Save DGaffney/789031 to your computer and use it in GitHub Desktop.

Select an option

Save DGaffney/789031 to your computer and use it in GitHub Desktop.
class AlgorithmManager
def self.return_chosen_algorithm
return AlgorithmManager::Algorithm
end
def self.post_run_procedures(function, *variables)
begin
if variables
self.send(function, variables)
else
self.send(function)
end
rescue NoMethodError => exception
puts exception
end
end
end
class AlgorithmManager::AlgorithmA < AlgorithmManager
def self.create_action_tags(one,two,three,four)
puts one,two,three,four
end
end
class AlgorithmManager::AlgorithmB < AlgorithmManager
def self.create_other_shit(one)
puts one
end
end
AlgorithmManager.return_chosen_algorithm.post_run_procedures("create_action_tags", 1,2,3,4)
AlgorithmManager.return_chosen_algorithm.post_run_procedures("create_other_shit", 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment