Class: Rapa::Signer
- Inherits:
-
Object
- Object
- Rapa::Signer
- Defined in:
- lib/rapa/signer.rb
Instance Method Summary collapse
-
#initialize(host:, http_method:, key:, path:, query_string:) ⇒ Signer
constructor
A new instance of Signer.
- #sign ⇒ String
Constructor Details
#initialize(host:, http_method:, key:, path:, query_string:) ⇒ Signer
Returns a new instance of Signer.
12 13 14 15 16 17 18 |
# File 'lib/rapa/signer.rb', line 12 def initialize(host:, http_method:, key:, path:, query_string:) @host = host @http_method = http_method @key = key @path = path @query_string = query_string end |
Instance Method Details
#sign ⇒ String
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rapa/signer.rb', line 21 def sign ::CGI.escape( ::Base64.encode64( ::OpenSSL::HMAC.digest( digest, key, source, ), ).chomp ) end |