Module: ApiAuth::Helpers

Overview

:nodoc:

Instance Method Summary collapse

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

#md5_base64digest(string) ⇒ Object



7
8
9
# File 'lib/api_auth/helpers.rb', line 7

def md5_base64digest(string)
  Digest::MD5.base64digest(string)
end