Sha256: 80bd31abb50308f50ac7f9592e37a366fdde3cb64496e0a75ca2f912e58c5f5a
Contents?: true
Size: 941 Bytes
Versions: 13
Compression:
Stored size: 941 Bytes
Contents
# frozen_string_literal: true module Kadmin class Configuration # @return [Logger] An instance of a Ruby compatible logger attr_accessor :logger # @return [String] the path the engine is mounted at (used for authentication routes) attr_accessor :mount_path # @return [Array<Kadmin::Navbar::Section, Kadmin::Navbar::Link>] list of admin links or sections attr_accessor :navbar_items # @return [Boolean] if true, any Kadmin::ApplicationController will catch errors and display a custom page attr_accessor :handle_errors def initialize @mount_path = '/admin' @logger = Rails.logger @navbar_items = [] @handle_errors = false end def add_navbar_items(*items) items.each do |item| index = @navbar_items.bsearch_index { |navbar_item| navbar_item.text >= item.text } @navbar_items.insert(index || @navbar_items.size, item) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems