diff options
Diffstat (limited to 'lib/nickserver/hkp')
-rw-r--r-- | lib/nickserver/hkp/fetch_key.rb | 2 | ||||
-rw-r--r-- | lib/nickserver/hkp/source.rb | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/lib/nickserver/hkp/fetch_key.rb b/lib/nickserver/hkp/fetch_key.rb index 55eeefa..fe00473 100644 --- a/lib/nickserver/hkp/fetch_key.rb +++ b/lib/nickserver/hkp/fetch_key.rb @@ -53,4 +53,4 @@ module Nickserver; module Hkp end end -end; end
\ No newline at end of file +end; end diff --git a/lib/nickserver/hkp/source.rb b/lib/nickserver/hkp/source.rb new file mode 100644 index 0000000..79333f0 --- /dev/null +++ b/lib/nickserver/hkp/source.rb @@ -0,0 +1,20 @@ +require 'nickserver/hkp/response' +module Nickserver::Hkp + class Source + + def initialize(adapter) + end + + def query(nick) + fetcher.get(nick).callback {|key| + yield Response.new(nick, key) + }.errback {|status, msg| + yield Nickserver::Response.new(status, msg) + } + end + + def fetcher + Nickserver::Hkp::FetchKey.new + end + end +end |