Class: Railsboot::Navbar::BrandComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::Navbar::BrandComponent
- Defined in:
- app/components/railsboot/navbar/brand_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(tag: "a", **html_attributes) ⇒ BrandComponent
constructor
A new instance of BrandComponent.
Constructor Details
#initialize(tag: "a", **html_attributes) ⇒ BrandComponent
Returns a new instance of BrandComponent.
2 3 4 5 6 7 8 9 10 11 |
# File 'app/components/railsboot/navbar/brand_component.rb', line 2 def initialize(tag: "a", **html_attributes) @tag = tag @html_attributes = html_attributes @html_attributes[:tag] = @tag @html_attributes[:class] = class_names( "navbar-brand", html_attributes.delete(:class) ) end |
Instance Method Details
#call ⇒ Object
13 14 15 |
# File 'app/components/railsboot/navbar/brand_component.rb', line 13 def call render(Railsboot::BaseComponent.new(**@html_attributes)) { content } end |