diff options
author | Jochen Topf <jochen@topf.org> | 2012-01-21 13:35:33 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2012-01-21 13:35:33 +0100 |
commit | 25e91a72ca533544ac344448e31f822af1f8ddd8 (patch) | |
tree | 72c5bbb6306c10fb9078ca2933cec08dc961ebae /web/lib | |
parent | 5087a1c6d39243dd9b19924e152ca4b98b313d55 (diff) | |
download | taginfo-25e91a72ca533544ac344448e31f822af1f8ddd8.tar taginfo-25e91a72ca533544ac344448e31f822af1f8ddd8.tar.gz |
Rename "about" API call to "site" and document it
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/api/main.rb | 12 | ||||
-rw-r--r-- | web/lib/apidoc.rb | 6 |
2 files changed, 16 insertions, 2 deletions
diff --git a/web/lib/api/main.rb b/web/lib/api/main.rb index e48e716..4819972 100644 --- a/web/lib/api/main.rb +++ b/web/lib/api/main.rb @@ -1,7 +1,17 @@ # web/lib/api/main.rb class Taginfo < Sinatra::Base - api(2, 'about', { + api(2, 'site', { + :description => 'Get information about this taginfo site.', + :result => { + :url => :STRING, + :name => :STRING, + :description => :STRING, + :icon => :STRING, + :contact => :STRING, + :area => :STRING + }, + :example => { } }) do data = {} [:url, :name, :description, :icon, :contact, :area].each do |k| diff --git a/web/lib/apidoc.rb b/web/lib/apidoc.rb index ee4cc36..2486e5b 100644 --- a/web/lib/apidoc.rb +++ b/web/lib/apidoc.rb @@ -54,7 +54,11 @@ class APIDoc example.each_pair do |k,v| params << "#{k}=#{v}" end - complete_path + '?' + params.join('&') + if params.empty? + return complete_path + else + return complete_path + '?' + params.join('&') + end end def show_ui |