Sha256: 408dc7145340ae7aa4608afc92aad127e9456dc345c36d4618aacf4ec2c0ecd7

Contents?: true

Size: 1.81 KB

Versions: 22

Compression:

Stored size: 1.81 KB

Contents

module Vedeu

  module Menus

    # Allows the storing of menus by name.
    #
    class Repository < Vedeu::Repositories::Repository

      singleton_class.send(:alias_method, :menus, :repository)

      real Vedeu::Menus::Menu
      null Vedeu::Menus::Null

    end # Repository

  end # Menus

  # Manipulate the repository of menus.
  #
  # @example
  #   Vedeu.menus
  #
  # @!method menus
  # @return [Vedeu::Menus::Repository]
  def_delegators Vedeu::Menus::Repository,
                 :menus

  # :nocov:

  # See {file:docs/events/menu.md#\_menu_bottom_}
  Vedeu.bind(:_menu_bottom_) do |name|
    Vedeu.menus.by_name(name).bottom_item
  end

  # See {file:docs/events/menu.md#\_menu_current_}
  Vedeu.bind(:_menu_current_) do |name|
    Vedeu.menus.by_name(name).current_item
  end

  # See {file:docs/events/menu.md#\_menu_deselect_}
  Vedeu.bind(:_menu_deselect_) do |name|
    Vedeu.menus.by_name(name).deselect_item
  end

  # See {file:docs/events/menu.md#\_menu_items_}
  Vedeu.bind(:_menu_items_) { |name| Vedeu.menus.by_name(name).items }

  # See {file:docs/events/menu.md#\_menu_next_}
  Vedeu.bind(:_menu_next_) { |name| Vedeu.menus.by_name(name).next_item }

  # See {file:docs/events/menu.md#\_menu_prev_}
  Vedeu.bind(:_menu_prev_) { |name| Vedeu.menus.by_name(name).prev_item }

  # See {file:docs/events/menu.md#\_menu_selected_}
  Vedeu.bind(:_menu_selected_) do |name|
    Vedeu.menus.by_name(name).selected_item
  end

  # See {file:docs/events/menu.md#\_menu_select_}
  Vedeu.bind(:_menu_select_) do |name|
    Vedeu.menus.by_name(name).select_item
  end

  # See {file:docs/events/menu.md#\_menu_top_}
  Vedeu.bind(:_menu_top_) { |name| Vedeu.menus.by_name(name).top_item }

  # See {file:docs/events/menu.md#\_menu_view_}
  Vedeu.bind(:_menu_view_) { |name| Vedeu.menus.by_name(name).view }

  # :nocov:

end # Vedeu

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
vedeu-0.6.63 lib/vedeu/menus/repository.rb
vedeu-0.6.62 lib/vedeu/menus/repository.rb
vedeu-0.6.61 lib/vedeu/menus/repository.rb
vedeu-0.6.60 lib/vedeu/menus/repository.rb
vedeu-0.6.59 lib/vedeu/menus/repository.rb
vedeu-0.6.58 lib/vedeu/menus/repository.rb
vedeu-0.6.57 lib/vedeu/menus/repository.rb
vedeu-0.6.56 lib/vedeu/menus/repository.rb
vedeu-0.6.54 lib/vedeu/menus/repository.rb
vedeu-0.6.53 lib/vedeu/menus/repository.rb
vedeu-0.6.52 lib/vedeu/menus/repository.rb
vedeu-0.6.51 lib/vedeu/menus/repository.rb
vedeu-0.6.50 lib/vedeu/menus/repository.rb
vedeu-0.6.49 lib/vedeu/menus/repository.rb
vedeu-0.6.48 lib/vedeu/menus/repository.rb
vedeu-0.6.47 lib/vedeu/menus/repository.rb
vedeu-0.6.46 lib/vedeu/menus/repository.rb
vedeu-0.6.45 lib/vedeu/menus/repository.rb
vedeu-0.6.44 lib/vedeu/menus/repository.rb
vedeu-0.6.43 lib/vedeu/menus/repository.rb