summaryrefslogtreecommitdiff
path: root/lib/nickserver/wkd/url.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2017-09-23 13:43:29 +0200
committerAzul <azul@riseup.net>2017-09-23 16:53:27 +0200
commitf40ef14010af08c49810c0a6a2349072948170e6 (patch)
tree19a2b13d35bb45b7d36c0c6f84fd483efbf55ece /lib/nickserver/wkd/url.rb
parent40916407517f4bdb75a295caf29e02d4f403349b (diff)
style: more rubocop fixes
Diffstat (limited to 'lib/nickserver/wkd/url.rb')
-rw-r--r--lib/nickserver/wkd/url.rb35
1 files changed, 17 insertions, 18 deletions
diff --git a/lib/nickserver/wkd/url.rb b/lib/nickserver/wkd/url.rb
index 6530efc..0ccff38 100644
--- a/lib/nickserver/wkd/url.rb
+++ b/lib/nickserver/wkd/url.rb
@@ -1,29 +1,28 @@
require 'digest/sha1'
require 'zbase32'
-module Nickserver
- module Wkd
- class Url
- def initialize(email)
- @domain = email.domain.downcase
- @local_part = email.local_part.downcase
- end
+module Nickserver::Wkd
+ # The url to lookup the given email address in the web key directory.
+ class Url
+ def initialize(email)
+ @domain = email.domain.downcase
+ @local_part = email.local_part.downcase
+ end
- def to_s
- "https://#{domain}/.well-known/openpgpkey/hu/#{encoded_digest}"
- end
+ def to_s
+ "https://#{domain}/.well-known/openpgpkey/hu/#{encoded_digest}"
+ end
- protected
+ protected
- attr_reader :domain, :local_part
+ attr_reader :domain, :local_part
- def encoded_digest
- ZBase32.encode32(digest.to_i(16).to_s(2))
- end
+ def encoded_digest
+ ZBase32.encode32(digest.to_i(16).to_s(2))
+ end
- def digest
- Digest::SHA1.hexdigest local_part
- end
+ def digest
+ Digest::SHA1.hexdigest local_part
end
end
end