From 80d85a0396fb0dbb27ac1b0885d5461ccc0cfbf2 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 9 Jun 2016 11:54:04 +0200 Subject: refactor: introduce Hkp::Response --- lib/nickserver/hkp/response.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/nickserver/hkp/response.rb (limited to 'lib/nickserver/hkp') diff --git a/lib/nickserver/hkp/response.rb b/lib/nickserver/hkp/response.rb new file mode 100644 index 0000000..c52e25f --- /dev/null +++ b/lib/nickserver/hkp/response.rb @@ -0,0 +1,18 @@ +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 -- cgit v1.2.3