diff options
author | rautenberg <rautenberg@in-silico.ch> | 2016-10-05 12:54:09 +0200 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2016-10-05 12:54:09 +0200 |
commit | f8def6040e35511fde6456b6d7cff928b71a8156 (patch) | |
tree | 111497122efaaac03b4bc5a17a2a6e6c0cb5ddce | |
parent | c7edf2df2bac8642fa1635a364e0314c1be79c5c (diff) |
fix descriptor calculation
-rw-r--r-- | lib/compound.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compound.rb b/lib/compound.rb index 693cdc7..99e6c7e 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -7,7 +7,7 @@ get "/compound/descriptor/?:descriptor?" do when "application/json" return "#{JSON.pretty_generate PhysChem::DESCRIPTORS} " unless params[:descriptor] return {params[:descriptor] => PhysChem::DESCRIPTORS[params[:descriptor]]}.to_json if PhysChem::DESCRIPTORS.include?(params[:descriptor]) - return {PhysChem.find(params[:descriptor])}.to_json if PhysChem.find(params[:descriptor]) + return PhysChem.find(params[:descriptor]).to_json if PhysChem.find(params[:descriptor]) else return PhysChem::DESCRIPTORS.collect{|k, v| "#{k}: #{v}\n"} unless params[:descriptor] return PhysChem::DESCRIPTORS[params[:descriptor]] if PhysChem::DESCRIPTORS.include?(params[:descriptor]) |