def load_new_examples
@collector.records.reduce({}) do |h, (method, calls)|
showed_in_versions = Set.new
recorded_examples = calls.map do |call|
method_descriptions = Apipie.get_method_descriptions(call[:controller], call[:action])
call[:versions] = method_descriptions.map(&:version)
if call[:versions].any? { |v| ! showed_in_versions.include?(v) }
call[:versions].each { |v| showed_in_versions << v }
show_in_doc = 1
else
show_in_doc = 0
end
example = call.merge(:show_in_doc => show_in_doc.to_i, :recorded => true)
example
end
h.update(method => recorded_examples)
end
end