Class: Decidim::Toggle::SettingsTabItem
- Inherits:
-
Object
- Object
- Decidim::Toggle::SettingsTabItem
- Defined in:
- lib/decidim/toggle/settings_tab_item.rb
Instance Attribute Summary collapse
-
#command_class ⇒ Object
readonly
Returns the value of attribute command_class.
-
#form_class ⇒ Object
readonly
Returns the value of attribute form_class.
-
#form_layout_partial ⇒ Object
readonly
Returns the value of attribute form_layout_partial.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#module_name ⇒ Object
readonly
Returns the value of attribute module_name.
-
#position ⇒ Object
Returns the value of attribute position.
Instance Method Summary collapse
- #form_tab? ⇒ Boolean
-
#initialize(identifier, label, options = {}) ⇒ SettingsTabItem
constructor
A new instance of SettingsTabItem.
- #open? ⇒ Boolean
- #visible? ⇒ Boolean
Constructor Details
#initialize(identifier, label, options = {}) ⇒ SettingsTabItem
Returns a new instance of SettingsTabItem.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 6 def initialize(identifier, label, = {}) @identifier = identifier @label = label @form_layout_partial = [:form_layout_partial] @form_class = [:form_class] @command_class = [:command_class] @position = [:position] || Float::INFINITY @if = [:if] @open = .fetch(:open, false) @module_name = [:module_name] end |
Instance Attribute Details
#command_class ⇒ Object (readonly)
Returns the value of attribute command_class.
18 19 20 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 18 def command_class @command_class end |
#form_class ⇒ Object (readonly)
Returns the value of attribute form_class.
18 19 20 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 18 def form_class @form_class end |
#form_layout_partial ⇒ Object (readonly)
Returns the value of attribute form_layout_partial.
18 19 20 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 18 def form_layout_partial @form_layout_partial end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
18 19 20 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 18 def identifier @identifier end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
18 19 20 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 18 def label @label end |
#module_name ⇒ Object (readonly)
Returns the value of attribute module_name.
18 19 20 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 18 def module_name @module_name end |
#position ⇒ Object
Returns the value of attribute position.
20 21 22 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 20 def position @position end |
Instance Method Details
#form_tab? ⇒ Boolean
22 23 24 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 22 def form_tab? form_class.present? && command_class.present? end |
#open? ⇒ Boolean
26 27 28 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 26 def open? @open end |
#visible? ⇒ Boolean
30 31 32 33 34 |
# File 'lib/decidim/toggle/settings_tab_item.rb', line 30 def visible? return true if @if.nil? || @if false end |