lib/attractor/reporters/sinatra_reporter.rb in attractor-0.3.4 vs lib/attractor/reporters/sinatra_reporter.rb in attractor-0.4.0
- old
+ new
@@ -21,19 +21,19 @@
enable :static
set :public_folder, File.expand_path('../../../app/assets', __dir__)
get '/' do
- @suggestions = @reporter.suggestions
erb File.read(File.expand_path('../../../app/views/index.html.erb', __dir__))
end
get '/values' do
@reporter.values.to_json
end
get '/suggestions' do
- @reporter.suggestions.to_json
+ threshold = params[:t] || 95
+ @reporter.suggestions(threshold).to_json
end
end
# serving the HTML locally
class SinatraReporter < Reporter