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



1742
1743
1744
1745
1746
1747
1748
1749
# File 'lib/hub_sso_lib.rb', line 1742

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

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

  return roles
end