Class: AblyUi::Core::Meganav

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
MeganavConfig, 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 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', url_base: AblyUi::Core::Util::DEFAULT_URL_BASE) ⇒ Meganav

Returns a new instance of Meganav.



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

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

Instance Attribute Details

Returns the value of attribute login_link.



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

def 
  @login_link
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#url_baseObject (readonly)

Returns the value of attribute url_base.



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

def url_base
  @url_base
end

Instance Method Details

#panelsObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ably_ui/core/meganav/meganav.rb', line 27

def panels
  [
    {
      label: 'Platform',
      id: 'platform-panel',
      class: 'AblyUi::Core::MeganavContentPlatform'
    },
    {
      label: 'Use Cases',
      id: 'use-cases-panel',
      class: 'AblyUi::Core::MeganavContentUseCases'
    },
    {
      label: 'Why Ably',
      id: 'why-ably-panel',
      class: 'AblyUi::Core::MeganavContentWhyAbly'
    },
    {
      label: 'Developers',
      id: 'developers-panel',
      class: 'AblyUi::Core::MeganavContentDevelopers'
    }
  ]
end