class GeneGenie::TemplateEvaluator
A Template Evaluator provides certain analysis and useful information about templates @since 0.0.2
Public Class Methods
new(template)
click to toggle source
# File lib/gene_genie/template_evaluator.rb, line 6 def initialize(template) @template = template end
Public Instance Methods
permutations()
click to toggle source
# File lib/gene_genie/template_evaluator.rb, line 10 def permutations @permutations ||= @template.map { |hash| hash.map { |_, v| v.size }.reduce(:*) }.reduce(:*) end
recommended_size()
click to toggle source
returns a minimum of 10 unless the total number of permutations is below that otherwise, returns 1/1000th of the number of permutations up to a maximum of 1000
# File lib/gene_genie/template_evaluator.rb, line 20 def recommended_size [ [(permutations / 100_000), 5000].min, [10, permutations].min, ].max end