Class: SwitchUser::Record
- Inherits:
-
Struct
- Object
- Struct
- SwitchUser::Record
- Defined in:
- lib/switch_user/data_source.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
Returns the value of attribute source.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source
41 42 43 |
# File 'lib/switch_user/data_source.rb', line 41 def source @source end |
#user ⇒ Object
Returns the value of attribute user
41 42 43 |
# File 'lib/switch_user/data_source.rb', line 41 def user @user end |
Instance Method Details
#equivalent?(other_scope_id) ⇒ Boolean
42 43 44 |
# File 'lib/switch_user/data_source.rb', line 42 def equivalent?(other_scope_id) scope_id == other_scope_id end |
#label ⇒ Object
50 51 52 |
# File 'lib/switch_user/data_source.rb', line 50 def label user.send(source.name) end |
#scope ⇒ Object
54 55 56 |
# File 'lib/switch_user/data_source.rb', line 54 def scope source.scope end |
#scope_id ⇒ Object
46 47 48 |
# File 'lib/switch_user/data_source.rb', line 46 def scope_id "#{source.scope}_#{user.send(source.identifier)}" end |