Sha256: 6382f4c522b34f6fa26552cb8574f5bc49fb707b77409b2334b944d59cea15ac
Contents?: true
Size: 503 Bytes
Versions: 6
Compression:
Stored size: 503 Bytes
Contents
# frozen_string_literal: true module RailsMenuManager # Representation of a single menu item class MenuItem PATH_SEPARATOR = 0x1F.chr attr_reader :path, :options def initialize(path, options = {}) @path = path @options = options end def in?(*args) return false if path.nil? (path_as_string(path) =~ /\A#{path_as_string(args)}/i) end private def path_as_string(path) path.join(PATH_SEPARATOR) + PATH_SEPARATOR end end end
Version data entries
6 entries across 6 versions & 1 rubygems