Class: Railsboot::Toast::BodyComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/railsboot/toast/body_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(**html_attributes) ⇒ BodyComponent

Returns a new instance of BodyComponent.



2
3
4
5
6
7
8
9
10
# File 'app/components/railsboot/toast/body_component.rb', line 2

def initialize(**html_attributes)
  @html_attributes = html_attributes

  @html_attributes[:tag] = "div"
  @html_attributes[:class] = class_names(
    "toast-body",
    html_attributes.delete(:class)
  )
end

Instance Method Details

#callObject



12
13
14
# File 'app/components/railsboot/toast/body_component.rb', line 12

def call
  render(Railsboot::BaseComponent.new(**@html_attributes)) { content }
end