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 34
def self.as_array scope
  case scope
  when Array
    scope
  when String
    scope.split
  else
    raise "Invalid scope value. Must be string or array"
  end
end
normalize(scope) click to toggle source
# File lib/googleauth/scope_util.rb, line 29
def self.normalize scope
  list = as_array scope
  list.map { |item| ALIASES[item] || item }
end