Class: Railsboot::Navbar::BrandComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/railsboot/navbar/brand_component.rb

Instance Method Summary collapse

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

#callObject



13
14
15
# File 'app/components/railsboot/navbar/brand_component.rb', line 13

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