Class: Alchemy::Admin::LinkDialog::Tabs

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/alchemy/admin/link_dialog/tabs.rb

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Tabs

Returns a new instance of Tabs.



15
16
17
18
19
20
21
# File 'app/components/alchemy/admin/link_dialog/tabs.rb', line 15

def initialize(**options)
  options.symbolize_keys!
  @url = options[:url]
  @selected_tab = options[:selected_tab]
  @link_title = options[:link_title]
  @link_target = options[:link_target]
end

Instance Method Details

#is_selected?(tab) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/components/alchemy/admin/link_dialog/tabs.rb', line 23

def is_selected?(tab)
  @selected_tab&.to_sym == tab.panel_name
end

#tabsObject



27
28
29
# File 'app/components/alchemy/admin/link_dialog/tabs.rb', line 27

def tabs
  Alchemy.link_dialog_tabs
end