Class: Railsboot::Offcanvas::BodyComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::Offcanvas::BodyComponent
- Defined in:
- app/components/railsboot/offcanvas/body_component.rb
Overview
ViewComponent: renders the body block.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**html_attributes) ⇒ BodyComponent
constructor
A new instance of BodyComponent.
Constructor Details
#initialize(**html_attributes) ⇒ BodyComponent
Returns a new instance of BodyComponent.
4 5 6 7 8 9 10 11 12 |
# File 'app/components/railsboot/offcanvas/body_component.rb', line 4 def initialize(**html_attributes) @html_attributes = html_attributes @html_attributes[:tag] = "div" @html_attributes[:class] = class_names( "offcanvas-body", html_attributes.delete(:class) ) end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'app/components/railsboot/offcanvas/body_component.rb', line 14 def call render(Railsboot::BaseComponent.new(**@html_attributes)) { content } end |