summaryrefslogtreecommitdiff
path: root/app/models/tournament.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/tournament.rb')
-rw-r--r--app/models/tournament.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/models/tournament.rb b/app/models/tournament.rb
index 61b4700..2d4d6b6 100644
--- a/app/models/tournament.rb
+++ b/app/models/tournament.rb
@@ -93,4 +93,29 @@ class Tournament < ActiveRecord::Base
def sampling
@sampling ||= "Sampling::#{self.sampling_method.camelcase}".constantize
end
+
+ # YISSSSSS
+ def self.make_methods(dir)
+ @methods ||= {}
+ if @methods[dir].nil? or Rails.env.development?
+ @methods[dir] = Dir.glob("#{Rails.root}/lib/#{dir}/*.rb").map{|filename| File.basename(filename, ".rb").humanize }
+ end
+ return @methods[dir]
+ end
+
+ def self.scoring_methods
+ make_methods "scoring"
+ end
+
+ def self.sampling_methods
+ make_methods "sampling"
+ end
+
+ def self.scheduling_methods
+ make_methods "scheduling"
+ end
+
+ def self.seeding_methods
+ make_methods "seeding"
+ end
end