diff options
Diffstat (limited to 'lib/nickserver/hkp')
-rw-r--r-- | lib/nickserver/hkp/response.rb | 16 | ||||
-rw-r--r-- | lib/nickserver/hkp/source.rb | 4 |
2 files changed, 2 insertions, 18 deletions
diff --git a/lib/nickserver/hkp/response.rb b/lib/nickserver/hkp/response.rb deleted file mode 100644 index 2cc69d3..0000000 --- a/lib/nickserver/hkp/response.rb +++ /dev/null @@ -1,16 +0,0 @@ -module Nickserver::Hkp - class Response - attr_reader :status, :content - - def initialize(uid, key) - @content = format_response(address: uid, openpgp: key) - @status = 200 - end - - protected - - def format_response(map) - map.to_json - end - end -end diff --git a/lib/nickserver/hkp/source.rb b/lib/nickserver/hkp/source.rb index d7c86a3..fe3c4a5 100644 --- a/lib/nickserver/hkp/source.rb +++ b/lib/nickserver/hkp/source.rb @@ -1,6 +1,6 @@ require 'nickserver/source' require 'nickserver/response' -require 'nickserver/hkp/response' +require 'nickserver/key_response' require 'nickserver/hkp/client' require 'nickserver/hkp/parse_key_info' require 'nickserver/hkp/key_info' @@ -30,7 +30,7 @@ module Nickserver::Hkp def get_key_by_fingerprint(fingerprint, nick = nil) status, response = client.get_key_by_fingerprint fingerprint if status == 200 - Response.new nick, response + Nickserver::KeyResponse.new nick, response else Nickserver::Response.new status, 'HKP Request failed' end |