module Google::Auth::ScopeUtil

Small utility for normalizing scopes into canonical form

Constants

ALIASES

Public Class Methods

as_array(scope) click to toggle source
# File lib/googleauth/scope_util.rb, line 49
def self.as_array(scope)
  case scope
  when Array
    scope
  when String
    scope.split(' ')
  else
    fail 'Invalid scope value. Must be string or array'
  end
end
normalize(scope) click to toggle source
# File lib/googleauth/scope_util.rb, line 44
def self.normalize(scope)
  list = as_array(scope)
  list.map { |item| ALIASES[item] || item }
end