Sha256: 20b3b0dfe8ac671ecf8c5effec857b58cc16916a8c03d9d683749a21db9350bd

Contents?: true

Size: 635 Bytes

Versions: 40

Compression:

Stored size: 635 Bytes

Contents

# frozen_string_literal: true

module Satis
  module Menus
    class Menu
      attr_reader :items, :level, :event, :show_scroll
      def initialize(*args, **kwargs)
        @options = args.extract_options!
        @items = []
        @scope = Array.wrap(args.first)
        @level = kwargs[:level] || 0
        @event = kwargs[:event] || "mouseover"
        @show_scroll = kwargs[:show_scroll] || false
        yield self if block_given?
      end

      def item(*args, **kwargs, &block)
        kwargs[:scope] = @scope
        kwargs[:level] = @level
        @items << Item.new(*args, **kwargs, &block)
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
satis-2.1.47 lib/satis/menus/menu.rb
satis-2.1.46 lib/satis/menus/menu.rb
satis-2.1.45 lib/satis/menus/menu.rb
satis-2.1.44 lib/satis/menus/menu.rb
satis-2.1.43 lib/satis/menus/menu.rb
satis-2.1.42 lib/satis/menus/menu.rb
satis-2.1.41 lib/satis/menus/menu.rb
satis-2.1.40 lib/satis/menus/menu.rb
satis-2.1.39 lib/satis/menus/menu.rb
satis-2.1.38 lib/satis/menus/menu.rb
satis-2.1.37 lib/satis/menus/menu.rb
satis-2.1.36 lib/satis/menus/menu.rb
satis-2.1.35 lib/satis/menus/menu.rb
satis-2.1.33 lib/satis/menus/menu.rb
satis-2.1.31 lib/satis/menus/menu.rb
satis-2.1.30 lib/satis/menus/menu.rb
satis-2.1.29 lib/satis/menus/menu.rb
satis-2.1.28 lib/satis/menus/menu.rb
satis-2.1.27 lib/satis/menus/menu.rb
satis-2.1.26 lib/satis/menus/menu.rb