Class: AblyUi::Core::Meganav

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
MeganavConfig, SharedAssets, Util
Defined in:
lib/ably_ui/core/meganav/meganav.rb

Constant Summary

Constants included from Util

Util::DEFAULT_URL_BASE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SharedAssets

#ably_logo, #ably_stack_path, #aws_logo_path, #highest_performer, #highest_user_adoption, #users_love_us

Methods included from Util

#abs_url, #append_random_postfix

Methods included from MeganavConfig

#theme, #theme_setup, #themes

Constructor Details

#initialize(session_data: {}, theme_name: :white, login_link: '/login', logo_link: '', url_base: AblyUi::Core::Util::DEFAULT_URL_BASE) ⇒ Meganav

Returns a new instance of Meganav.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ably_ui/core/meganav/meganav.rb', line 14

def initialize(
  session_data: {},
  theme_name: :white,
  login_link: '/login',
  logo_link: '',
  url_base: AblyUi::Core::Util::DEFAULT_URL_BASE
)
  @session_data = session_data
  @theme_name = theme_name
  @options = options
  @login_link = 
  @url_base = url_base
  @logo_link = logo_link || url_base
  theme_setup(theme_name)
end

Instance Attribute Details

Returns the value of attribute login_link.



10
11
12
# File 'lib/ably_ui/core/meganav/meganav.rb', line 10

def 
  @login_link
end

Returns the value of attribute logo_link.



10
11
12
# File 'lib/ably_ui/core/meganav/meganav.rb', line 10

def logo_link
  @logo_link
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/ably_ui/core/meganav/meganav.rb', line 10

def options
  @options
end

#url_baseObject (readonly)

Returns the value of attribute url_base.



10
11
12
# File 'lib/ably_ui/core/meganav/meganav.rb', line 10

def url_base
  @url_base
end

Instance Method Details

#panelsObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/ably_ui/core/meganav/meganav.rb', line 30

def panels
  [
    {
      label: 'Platform',
      short_label: 'Platform',
      id: 'platform-panel',
      class: 'AblyUi::Core::MeganavContentPlatform'
    },
    {
      label: 'Solutions',
      short_label: 'Solutions',
      id: 'use-cases-panel',
      class: 'AblyUi::Core::MeganavContentUseCases'
    },
    {
      label: 'Company',
      short_label: 'Company',
      id: 'company-panel',
      class: 'AblyUi::Core::MeganavContentCompany'
    },
    {
      label: 'Developers',
      short_label: 'Developers',
      id: 'developers-panel',
      class: 'AblyUi::Core::MeganavContentDevelopers'
    }
  ]
end