Class: Brainzlab::Components::NavItem

Inherits:
Base
  • Object
show all
Defined in:
lib/brainzlab/components/nav_item.rb

Instance Method Summary collapse

Methods inherited from Base

#classes

Constructor Details

#initialize(href: '#', active: false, **attrs) ⇒ NavItem

Returns a new instance of NavItem.



6
7
8
9
10
# File 'lib/brainzlab/components/nav_item.rb', line 6

def initialize(href: '#', active: false, **attrs)
  @href = href
  @active = active
  @attrs = attrs
end

Instance Method Details

#view_templateObject



12
13
14
15
16
17
18
19
# File 'lib/brainzlab/components/nav_item.rb', line 12

def view_template(&)
  a(
    href: @href,
    class: nav_item_classes,
    **@attrs,
    &
  )
end