Class: AblyUi::Core::MeganavItemsSignedIn
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- AblyUi::Core::MeganavItemsSignedIn
- Includes:
- MeganavConfig, Util
- Defined in:
- lib/ably_ui/core/meganav_items_signed_in/meganav_items_signed_in.rb
Constant Summary
Constants included from Util
Instance Attribute Summary collapse
-
#url_base ⇒ Object
readonly
Returns the value of attribute url_base.
Instance Method Summary collapse
-
#access_tokens? ⇒ Boolean
Access tokens are behind a feature flag.
- #account? ⇒ Boolean
- #account_name ⇒ Object
-
#initialize(session_data:, theme_name:, url_base:) ⇒ MeganavItemsSignedIn
constructor
A new instance of MeganavItemsSignedIn.
- #preferred_email ⇒ Object
Methods included from Util
#abs_url, #append_random_postfix
Methods included from MeganavConfig
#panels, #theme, #theme_setup, #themes
Constructor Details
#initialize(session_data:, theme_name:, url_base:) ⇒ MeganavItemsSignedIn
Returns a new instance of MeganavItemsSignedIn.
9 10 11 12 13 |
# File 'lib/ably_ui/core/meganav_items_signed_in/meganav_items_signed_in.rb', line 9 def initialize(session_data:, theme_name:, url_base:) @theme_name = theme_name @session_data = session_data @url_base = url_base end |
Instance Attribute Details
#url_base ⇒ Object (readonly)
Returns the value of attribute url_base.
7 8 9 |
# File 'lib/ably_ui/core/meganav_items_signed_in/meganav_items_signed_in.rb', line 7 def url_base @url_base end |
Instance Method Details
#access_tokens? ⇒ Boolean
Access tokens are behind a feature flag
20 21 22 |
# File 'lib/ably_ui/core/meganav_items_signed_in/meganav_items_signed_in.rb', line 20 def access_tokens? @session_data[:myAccessTokens].present? end |
#account? ⇒ Boolean
15 16 17 |
# File 'lib/ably_ui/core/meganav_items_signed_in/meganav_items_signed_in.rb', line 15 def account? @session_data[:account].present? end |
#account_name ⇒ Object
24 25 26 |
# File 'lib/ably_ui/core/meganav_items_signed_in/meganav_items_signed_in.rb', line 24 def account_name truncate(@session_data[:accountName], length: 20) end |
#preferred_email ⇒ Object
28 29 30 |
# File 'lib/ably_ui/core/meganav_items_signed_in/meganav_items_signed_in.rb', line 28 def preferred_email truncate(@session_data[:preferredEmail], length: 20) end |