You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: nav_helper.rb
    path of file: ./repos/bh/lib/bh/helpers
    
    the code of the file until where you have to start completion: require 'bh/classes/nav'
require 'bh/classes/navbar'

module Bh
  module Helpers
    # Displays a Bootstrap-styled nav.
    # @see http://getbo
    
    def nav(options = {}, &block)
      nav = Bh::Nav.new(self, options, &block)
      nav.extract! :as, :layout

      nav.append_class! :nav
      if Bh::Stack.find(Bh::Navbar)
        nav.append_class! :'navbar-nav'
      else
        nav.merge! role: :tablist
        nav.append_class! nav.style_class
        nav.append_class! nav.layout_class
      end