Class: FoxTail::Accordion::ItemComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- FoxTail::Accordion::ItemComponent
- Defined in:
- app/components/fox_tail/accordion/item_component.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #before_render ⇒ Object
- #body_id ⇒ Object
- #call ⇒ Object
-
#initialize(id, title, html_attributes = {}) ⇒ ItemComponent
constructor
A new instance of ItemComponent.
- #trigger_id ⇒ Object
Constructor Details
#initialize(id, title, html_attributes = {}) ⇒ ItemComponent
Returns a new instance of ItemComponent.
64 65 66 67 68 |
# File 'app/components/fox_tail/accordion/item_component.rb', line 64 def initialize(id, title, html_attributes = {}) @id = id @title = title super(html_attributes) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'app/components/fox_tail/accordion/item_component.rb', line 4 def id @id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'app/components/fox_tail/accordion/item_component.rb', line 4 def title @title end |
Instance Method Details
#before_render ⇒ Object
78 79 80 81 82 |
# File 'app/components/fox_tail/accordion/item_component.rb', line 78 def before_render super html_attributes[:class] = classnames theme.apply(:root, self), html_class end |
#body_id ⇒ Object
70 71 72 |
# File 'app/components/fox_tail/accordion/item_component.rb', line 70 def body_id :"#{id}_body" end |
#call ⇒ Object
84 85 86 87 88 89 |
# File 'app/components/fox_tail/accordion/item_component.rb', line 84 def call content_tag :div, html_attributes do concat render_header concat render_body end end |
#trigger_id ⇒ Object
74 75 76 |
# File 'app/components/fox_tail/accordion/item_component.rb', line 74 def trigger_id :"#{id}_trigger" end |