summaryrefslogtreecommitdiff
path: root/lib/nickserver/couch_db
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-07-02 12:03:46 +0200
committerAzul <azul@riseup.net>2016-07-02 12:03:46 +0200
commitfb2d7e6f8f1fceefbc8964d34369a867eb8f25bb (patch)
tree672ea8bbf03876d65c90ecb1ed152424e74939e1 /lib/nickserver/couch_db
parent8a664a39bc3dd77a9c53fa5931f81c2b2b8b7295 (diff)
refactor: replace blocks/yields with returns
This became possible because we now use celluloid. Celluloid handles asynchronity without the need for callbacks or blocks.
Diffstat (limited to 'lib/nickserver/couch_db')
-rw-r--r--lib/nickserver/couch_db/source.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/nickserver/couch_db/source.rb b/lib/nickserver/couch_db/source.rb
index b30fdfc..7c3ad95 100644
--- a/lib/nickserver/couch_db/source.rb
+++ b/lib/nickserver/couch_db/source.rb
@@ -11,9 +11,8 @@ module Nickserver::CouchDB
VIEW = '/_design/Identity/_view/pgp_key_by_email'
def query(nick)
- adapter.get url, query: query_for(nick) do |status, body|
- yield Response.new(nick, status: status, body: body)
- end
+ status, body = adapter.get url, query: query_for(nick)
+ Response.new(nick, status: status, body: body)
end
protected