Class: Railsboot::Navbar::NavComponent

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

Instance Method Summary collapse

Constructor Details

#initialize(tag: "nav", **html_attributes) ⇒ NavComponent

Returns a new instance of NavComponent.



4
5
6
7
8
9
10
11
12
13
# File 'app/components/railsboot/navbar/nav_component.rb', line 4

def initialize(tag: "nav", **html_attributes)
  @tag = tag
  @html_attributes = html_attributes

  @html_attributes[:tag] = @tag
  @html_attributes[:class] = class_names(
    "navbar-nav",
    html_attributes.delete(:class)
  )
end