Test for Pruner

This commit is contained in:
Senad Uka
2018-08-13 18:54:12 +02:00
parent 5684e58826
commit 973f1e1093
15 changed files with 2888 additions and 53 deletions

View File

@@ -7,17 +7,15 @@ require_relative '../exceptions'
module Pruning
module API
# Handles all tree related API requests
class Tree < App
get '/tree/:name' do
tree_repo = Pruning::Repos::Tree.new(RestClient, ENV['TREE_SOURCE_API_HOSTNAME'])
complete_tree = tree_repo.get(query.name)
pruner = Pruning::Processing::Pruner.new(complete_tree)
pruner.prune_tree(query.indicator_ids)
tree_repo = Pruning::Repos::Tree.new(RestClient,
ENV['TREE_SOURCE_API_HOSTNAME'])
complete_tree = tree_repo.get(query.name)
pruner = Pruning::Processing::Pruner.new(complete_tree)
pruner.prune_tree(query.indicator_ids.to_a)
end
end
end
end
end