Class: Panda::Core::Admin::MyProfile::ConnectedAccountComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- Panda::Core::Admin::MyProfile::ConnectedAccountComponent
- Defined in:
- app/components/panda/core/admin/my_profile/connected_account_component.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#provider_info ⇒ Object
readonly
Returns the value of attribute provider_info.
Instance Method Summary collapse
- #connected? ⇒ Boolean
-
#initialize(provider:, user:) ⇒ ConnectedAccountComponent
constructor
A new instance of ConnectedAccountComponent.
Constructor Details
#initialize(provider:, user:) ⇒ ConnectedAccountComponent
Returns a new instance of ConnectedAccountComponent.
8 9 10 11 12 13 14 15 16 |
# File 'app/components/panda/core/admin/my_profile/connected_account_component.rb', line 8 def initialize(provider:, user:) @provider = provider @user = user @provider_info = Panda::Core::OAuthProviders.info(provider) # TODO: Track which provider user logged in with # For now, we don't track the provider, so we can't show connection status @is_connected = user.respond_to?(:oauth_provider) && user.oauth_provider == provider.to_s super() end |
Instance Attribute Details
#provider_info ⇒ Object (readonly)
Returns the value of attribute provider_info.
18 19 20 |
# File 'app/components/panda/core/admin/my_profile/connected_account_component.rb', line 18 def provider_info @provider_info end |
Instance Method Details
#connected? ⇒ Boolean
20 21 22 |
# File 'app/components/panda/core/admin/my_profile/connected_account_component.rb', line 20 def connected? @is_connected end |