Class: Satis::Tab::Component
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Satis::Tab::Component
- Defined in:
- app/components/satis/tab/component.rb
Instance Attribute Summary collapse
-
#badge ⇒ Object
readonly
Returns the value of attribute badge.
-
#dirty ⇒ Object
readonly
Returns the value of attribute dirty.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#menu ⇒ Object
readonly
Returns the value of attribute menu.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
-
#responsive ⇒ Object
readonly
Returns the value of attribute responsive.
-
#selected ⇒ Object
readonly
Returns the value of attribute selected.
-
#selected_tab_index ⇒ Object
readonly
Returns the value of attribute selected_tab_index.
-
#tab_menu ⇒ Object
readonly
Returns the value of attribute tab_menu.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Attributes inherited from ApplicationComponent
Instance Method Summary collapse
- #call ⇒ Object
- #dirty? ⇒ Boolean
-
#initialize(name = nil, icon: nil, badge: nil, id: nil, tab_menu: nil, menu: nil, padding: false, dirty: false, title: nil, responsive: false, options: nil, selected_tab_index: nil, selected: false, &block) ⇒ Component
constructor
A new instance of Component.
- #responsive? ⇒ Boolean
- #selected? ⇒ Boolean
Methods inherited from ApplicationComponent
Constructor Details
#initialize(name = nil, icon: nil, badge: nil, id: nil, tab_menu: nil, menu: nil, padding: false, dirty: false, title: nil, responsive: false, options: nil, selected_tab_index: nil, selected: false, &block) ⇒ Component
Returns a new instance of Component.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/components/satis/tab/component.rb', line 9 def initialize(name = nil, icon: nil, badge: nil, id: nil, tab_menu: nil, menu: nil, padding: false, dirty: false, title: nil, responsive: false, options: nil, selected_tab_index: nil, selected: false, &block) super @name = name @icon = icon @id = id || name.to_s.underscore @badge = badge @padding = padding @dirty = dirty @title = title @responsive = responsive @selected = selected @menu = # FIXME: Obsolete these if .present? @menu ||= Satis::Deprecation.warn('Calling tab with the tab_menu parameter, use menu instead') end if selected_tab_index.present? @selected_tab_index = selected_tab_index # use selected Satis::Deprecation.warn('Calling tab with the selected_tab_index parameter, use selected instead') end @block = block end |
Instance Attribute Details
#badge ⇒ Object (readonly)
Returns the value of attribute badge.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def badge @badge end |
#dirty ⇒ Object (readonly)
Returns the value of attribute dirty.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def dirty @dirty end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def icon @icon end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def id @id end |
#menu ⇒ Object (readonly)
Returns the value of attribute menu.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def @menu end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def @options end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def padding @padding end |
#responsive ⇒ Object (readonly)
Returns the value of attribute responsive.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def responsive @responsive end |
#selected ⇒ Object (readonly)
Returns the value of attribute selected.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def selected @selected end |
#selected_tab_index ⇒ Object (readonly)
Returns the value of attribute selected_tab_index.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def selected_tab_index @selected_tab_index end |
#tab_menu ⇒ Object (readonly)
Returns the value of attribute tab_menu.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def @tab_menu end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'app/components/satis/tab/component.rb', line 6 def title @title end |
Instance Method Details
#call ⇒ Object
62 63 64 |
# File 'app/components/satis/tab/component.rb', line 62 def call content end |
#dirty? ⇒ Boolean
58 59 60 |
# File 'app/components/satis/tab/component.rb', line 58 def dirty? dirty == true end |
#responsive? ⇒ Boolean
50 51 52 |
# File 'app/components/satis/tab/component.rb', line 50 def responsive? responsive == true end |
#selected? ⇒ Boolean
54 55 56 |
# File 'app/components/satis/tab/component.rb', line 54 def selected? selected == true end |