Sha256: 48993b058d2567faa58e57f63b1fcd097318922f23e1151babc4bfda4f4e2fdd

Contents?: true

Size: 648 Bytes

Versions: 2

Compression:

Stored size: 648 Bytes

Contents

# frozen_string_literal: true

module Navigator
  # Navigation helper methods for the view layer.
  module NavigationHelper
    # rubocop:disable Metrics/ParameterLists
    def navigation tag = "ul", attributes: {}, activator: navigation_activator, &block
      Navigator::Menu.new(self, tag: tag, attributes: attributes, activator: activator, &block)
                     .render
                     .then { |html| raw html }
    end
    # rubocop:enable Metrics/ParameterLists

    module_function

    def current_path = request.env["PATH_INFO"]

    def navigation_activator = Navigator::TagActivator.new(search_value: current_path)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
navigator-6.1.0 app/helpers/navigator/navigation_helper.rb
navigator-6.0.3 app/helpers/navigator/navigation_helper.rb