Class: SwitchUser::DataSources
- Inherits:
-
Object
- Object
- SwitchUser::DataSources
- Defined in:
- lib/switch_user/data_source.rb
Instance Attribute Summary collapse
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
Instance Method Summary collapse
- #all ⇒ Object
- #find_scope_id(scope_id) ⇒ Object
-
#initialize(sources) ⇒ DataSources
constructor
A new instance of DataSources.
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
#sources ⇒ Object (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
#all ⇒ Object
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 |