Module: ApiAuth::Helpers
- Included in:
- ApiAuth, RequestDrivers::ActionControllerRequest, RequestDrivers::CurbRequest, RequestDrivers::FaradayRequest, RequestDrivers::GrapeRequest, RequestDrivers::HttpRequest, RequestDrivers::HttpiRequest, RequestDrivers::NetHttpRequest, RequestDrivers::RackRequest, RequestDrivers::RestClientRequest
- Defined in:
- lib/api_auth/helpers.rb
Overview
:nodoc:
Instance Method Summary collapse
- #b64_encode(string) ⇒ Object
-
#capitalize_keys(hsh) ⇒ Object
Capitalizes the keys of a hash.
- #sha256_base64digest(string) ⇒ Object
Instance Method Details
#b64_encode(string) ⇒ Object
3 4 5 |
# File 'lib/api_auth/helpers.rb', line 3 def b64_encode(string) Base64.strict_encode64(string) end |
#capitalize_keys(hsh) ⇒ Object
Capitalizes the keys of a hash
12 13 14 15 16 |
# File 'lib/api_auth/helpers.rb', line 12 def capitalize_keys(hsh) capitalized_hash = {} hsh.each_pair { |k, v| capitalized_hash[k.to_s.upcase] = v } capitalized_hash end |
#sha256_base64digest(string) ⇒ Object
7 8 9 |
# File 'lib/api_auth/helpers.rb', line 7 def sha256_base64digest(string) Digest::SHA256.base64digest(string) end |