Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/hub_sso_lib.rb

Overview

Method to return a Roles object created from the contents of the Array the method is invoked upon. The array contents will be flattened. After that, each entry must be a single role symbol or string equivalent. Comma-separated lists are not currently allowed (improvements to the roles class could easily give this, but the bloat isn’t needed).

Instance Method Summary collapse

Instance Method Details

#to_authenticated_rolesObject



1116
1117
1118
1119
1120
1121
1122
1123
# File 'lib/hub_sso_lib.rb', line 1116

def to_authenticated_roles
  roles = HubSsoLib::Roles.new
  roles.clear

  self.flatten.each { |entry| roles.add(entry.to_s) }

  return roles
end