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.
5 6 7 |
# File 'lib/switch_user/data_source.rb', line 5 def initialize(sources) @sources = sources end |
Instance Attribute Details
#sources ⇒ Object (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
#all ⇒ Object
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 |