Sha256: 8bd2b108736923a7dcc5c30e17cffe67f3b97d4a52bb63ed3b6fd86535da9dde

Contents?: true

Size: 764 Bytes

Versions: 1

Compression:

Stored size: 764 Bytes

Contents

# encoding: utf-8

module PagesCore
  class AdminMenuItem
    attr_reader :label, :path, :group, :options

    class << self
      def items
        return [] unless @menu_items
        @menu_items.map { |_, v| v }
      end

      def register(label, path, group = :custom, options = {})
        entry = new(label, path, group, options)
        @menu_items ||= {}
        @menu_items[[group, label]] = entry
      end
    end

    def initialize(label, path, group = :custom, options = {})
      @label = label
      @path = path
      @group = group
      @options = options
    end

    def ==(other)
      other &&
        other.label == label &&
        other.path == path &&
        other.group == group &&
        other.options == options
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pages_core-3.5.1 lib/pages_core/admin_menu_item.rb