Module: ApiAuth::Helpers
- Included in:
- ApiAuth, RequestDrivers::ActionControllerRequest, RequestDrivers::CurbRequest, RequestDrivers::RestClientRequest
- Defined in:
- lib/api_auth/helpers.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#b64_encode(string) ⇒ Object
Remove the ending new line character added by default.
-
#capitalize_keys(hsh) ⇒ Object
Capitalizes the keys of a hash.
Instance Method Details
#b64_encode(string) ⇒ Object
Remove the ending new line character added by default
6 7 8 |
# File 'lib/api_auth/helpers.rb', line 6 def b64_encode(string) Base64.encode64(string).strip end |
#capitalize_keys(hsh) ⇒ Object
Capitalizes the keys of a hash
11 12 13 14 15 |
# File 'lib/api_auth/helpers.rb', line 11 def capitalize_keys(hsh) capitalized_hash = {} hsh.each_pair {|k,v| capitalized_hash[k.to_s.upcase] = v } capitalized_hash end |