Module: Mach::HMAC
- Included in:
- Faraday::HmacAuthentication, Request
- Defined in:
- lib/mach/hmac.rb
Instance Method Summary collapse
- #mac_ext(ext) ⇒ Object
- #mac_host(host) ⇒ Object
- #mac_path(path, query_string) ⇒ Object
- #mac_port(port, scheme) ⇒ Object
- #mac_request_method(request_method) ⇒ Object
Instance Method Details
#mac_ext(ext) ⇒ Object
23 24 25 |
# File 'lib/mach/hmac.rb', line 23 def mac_ext(ext) ext end |
#mac_host(host) ⇒ Object
11 12 13 |
# File 'lib/mach/hmac.rb', line 11 def mac_host(host) host end |
#mac_path(path, query_string) ⇒ Object
7 8 9 |
# File 'lib/mach/hmac.rb', line 7 def mac_path(path, query_string) query_string && !query_string.empty? ? "#{path}?#{query_string}" : "#{path}" end |
#mac_port(port, scheme) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/mach/hmac.rb', line 15 def mac_port(port, scheme) unless port port = 80 if scheme == 'http' port = 443 if scheme == 'https' end port end |
#mac_request_method(request_method) ⇒ Object
3 4 5 |
# File 'lib/mach/hmac.rb', line 3 def mac_request_method(request_method) request_method.to_s.upcase end |