Module: WrapItRuby::Menu
- Extended by:
- Menu
- Included in:
- ApplicationController, Menu, MenuHelper
- Defined in:
- lib/wrap_it_ruby/menu.rb
Overview
Loads and queries the menu configuration from the host app’s config/menu.yml file.
Can be used as a module (extend self) or included in controllers/helpers.
Instance Method Summary collapse
Instance Method Details
#all_menu_items ⇒ Object
14 15 16 |
# File 'lib/wrap_it_ruby/menu.rb', line 14 def .flat_map { |item| [item, *item.fetch("items", [])] } end |
#all_proxy_menu_items ⇒ Object
18 19 20 |
# File 'lib/wrap_it_ruby/menu.rb', line 18 def .select { |item| item["type"] == "proxy" } end |
#menu_config ⇒ Object
12 |
# File 'lib/wrap_it_ruby/menu.rb', line 12 def = |
#proxy_paths ⇒ Object
22 23 24 25 26 |
# File 'lib/wrap_it_ruby/menu.rb', line 22 def proxy_paths .select { |item| item["type"] == "proxy" } .map { |item| item["route"] } end |