Class: Alchemy::Admin::LinkDialog::BaseTab

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

Direct Known Subclasses

AnchorTab, ExternalTab, FileTab, InternalTab

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseHelper

#alchemy_body_class, #alchemy_datepicker, #button_with_confirm, #clipboard_select_tag_options, #current_alchemy_user_name, #delete_button, #hint_with_tooltip, #js_filter_field, #link_to_confirm_dialog, #link_to_dialog, #link_url_regexp, #page_layout_missing_warning, #render_alchemy_title, #render_hint_for, #sites_for_select, #toolbar_button, #translations_for_select

Methods included from NavigationHelper

#alchemy_main_navigation_entry, #entry_active?, #main_navigation_css_classes, #navigate_module, #sorted_alchemy_modules, #url_for_module, #url_for_module_sub_navigation

Methods included from BaseHelper

#page_or_find, #render_icon, #render_message, #shorten, #warning

Constructor Details

#initialize(url, is_selected: false, link_title: "", link_target: nil) ⇒ BaseTab

Returns a new instance of BaseTab.



26
27
28
29
30
31
# File 'app/components/alchemy/admin/link_dialog/base_tab.rb', line 26

def initialize(url, is_selected: false, link_title: "", link_target: nil)
  @url = url
  @is_selected = is_selected
  @link_title = link_title
  @link_target = link_target
end

Instance Attribute Details

Returns the value of attribute link_target.



9
10
11
# File 'app/components/alchemy/admin/link_dialog/base_tab.rb', line 9

def link_target
  @link_target
end

Returns the value of attribute link_title.



9
10
11
# File 'app/components/alchemy/admin/link_dialog/base_tab.rb', line 9

def link_title
  @link_title
end

#urlObject (readonly)

Returns the value of attribute url.



9
10
11
# File 'app/components/alchemy/admin/link_dialog/base_tab.rb', line 9

def url
  @url
end

Class Method Details

.panel_nameObject

Raises:

  • (ArgumentError)


41
42
43
# File 'app/components/alchemy/admin/link_dialog/base_tab.rb', line 41

def self.panel_name
  raise ArgumentError, "The tab needs to have a panel name"
end

Instance Method Details

#fieldsObject



45
46
47
# File 'app/components/alchemy/admin/link_dialog/base_tab.rb', line 45

def fields
  []
end

#is_selected?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'app/components/alchemy/admin/link_dialog/base_tab.rb', line 33

def is_selected?
  @is_selected
end

#messageObject



49
50
51
# File 'app/components/alchemy/admin/link_dialog/base_tab.rb', line 49

def message
  ""
end

#titleObject

Raises:

  • (ArgumentError)


37
38
39
# File 'app/components/alchemy/admin/link_dialog/base_tab.rb', line 37

def title
  raise ArgumentError, "The tab needs to have a title"
end