class ActionView::MissingTemplate::Results
:nodoc:
def add(path, score)
def add(path, score) if should_record?(score) @results << Result.new(path, score) @results.sort_by!(&:score) @results.pop if @results.size > @size end end
def initialize(size)
def initialize(size) @size = size @results = [] end
def should_record?(score)
def should_record?(score) if @results.size < @size true else score < @results.last.score end end
def to_a
def to_a @results.map(&:path) end