Class: ItemComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- ItemComponent
- Defined in:
- app/components/item_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**args) ⇒ ItemComponent
constructor
A new instance of ItemComponent.
Constructor Details
#initialize(**args) ⇒ ItemComponent
Returns a new instance of ItemComponent.
7 8 9 |
# File 'app/components/item_component.rb', line 7 def initialize(**args) @args = args.presence || {} end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 |
# File 'app/components/item_component.rb', line 11 def call content_tag :div, class: [@args.delete(:class), "accordion_item"].compact.join(" "), data: { accordion_target: "item" }, **@args do header_component + body_component end end |