Class: SwitchUser::DataSources

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sources) ⇒ DataSources

Returns a new instance of DataSources.



5
6
7
# File 'lib/switch_user/data_source.rb', line 5

def initialize(sources)
  @sources = sources
end

Instance Attribute Details

#sourcesObject (readonly)

Returns the value of attribute sources.



3
4
5
# File 'lib/switch_user/data_source.rb', line 3

def sources
  @sources
end

Instance Method Details

#allObject



9
10
11
# File 'lib/switch_user/data_source.rb', line 9

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

#find_scope_id(scope_id) ⇒ Object



13
14
15
# File 'lib/switch_user/data_source.rb', line 13

def find_scope_id(scope_id)
  sources.map {|source| source.find_scope_id(scope_id) }.compact.first
end