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.



7
8
9
# File 'lib/switch_user/data_source.rb', line 7

def initialize(sources)
  @sources = sources
end

Instance Attribute Details

#sourcesObject (readonly)

Returns the value of attribute sources.



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

def sources
  @sources
end

Instance Method Details

#allObject



11
12
13
# File 'lib/switch_user/data_source.rb', line 11

def all
  sources.flat_map(&:all)
end

#find_scope_id(scope_id) ⇒ Object



15
16
17
# File 'lib/switch_user/data_source.rb', line 15

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