Class: SwitchUser::DataSources

Inherits:
Struct
  • Object
show all
Defined in:
lib/switch_user/data_source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sources ⇒ Object

Returns the value of attribute sources

Returns:

  • (Object) —

    the current value of sources



31
32
33
# File 'lib/switch_user/data_source.rb', line 31

def sources
  @sources
end

Instance Method Details

#find_scope_id(scope_id) ⇒ Object



36
37
38
# File 'lib/switch_user/data_source.rb', line 36

def find_scope_id(scope_id)
  users.flat_map.detect {|u| u.scope_id == scope_id }
end

#users ⇒ Object



32
33
34
# File 'lib/switch_user/data_source.rb', line 32

def users
  sources.flat_map {|source| source.users }
end