Sha256: d223cb5d46c90f0ac3ecbefae7ae009094166d612a0ea5f3a4bcf06ec9848654
Contents?: true
Size: 754 Bytes
Versions: 91
Compression:
Stored size: 754 Bytes
Contents
# frozen_string_literal: true module Decidim # # This class handles all logic regarding menu items # class MenuItem # Builds a new menu item # # @param label [String, Symbol] A compulsory label for the menu item # @param url [String, Symbol] The URL this item will link to # @param options [Hash] The options for the menu item # def initialize(label, url, options = {}) @label = label @url = url @position = options[:position] || Float::INFINITY @if = options[:if] @active = options[:active] @icon_name = options[:icon_name] end attr_reader :label, :url, :position, :active, :icon_name def visible? return true if @if.nil? || @if false end end end
Version data entries
91 entries across 91 versions & 2 rubygems