Class: NfgUi::Bootstrap::Components::NavbarToggler

Inherits:
Base
  • Object
show all
Includes:
Utilities::CollapseToggleable
Defined in:
lib/nfg_ui/bootstrap/components/navbar_toggler.rb

Overview

Bootstrap Navbar Component getbootstrap.com/docs/4.1/components/navbar/

Direct Known Subclasses

Components::Elements::NavbarToggler

Instance Attribute Summary

Attributes inherited from Base

#body, #options, #view_context

Instance Method Summary collapse

Methods included from Utilities::CollapseToggleable

#data

Methods included from Utilities::Collapsible

#collapse, #collapsed, #collapsible

Methods inherited from Base

#data, #href, #html_options, #id, #initialize, #style

Constructor Details

This class inherits a constructor from NfgUi::Bootstrap::Components::Base

Instance Method Details

#component_familyObject

Pass through to collapse component def collapse

options.fetch(:collapse, nil)

end



16
17
18
# File 'lib/nfg_ui/bootstrap/components/navbar_toggler.rb', line 16

def component_family
  :navbar
end

#renderObject



20
21
22
23
24
25
26
27
28
# File 'lib/nfg_ui/bootstrap/components/navbar_toggler.rb', line 20

def render
  super do
    if body
      (block_given? ? yield : body)
    else
      (:span, nil, class: 'navbar-toggler-icon')
    end
  end
end