class MenuMaker::Menu::MenuItem
Attributes
options[R]
title[R]
Public Class Methods
new(title, *paths, **options)
click to toggle source
# File lib/menu_maker/menu.rb, line 79 def initialize(title, *paths, **options) @title = title @paths = paths.map { |p| Path::Converter.convert(p) } @options = options end
Public Instance Methods
all_paths()
click to toggle source
# File lib/menu_maker/menu.rb, line 103 def all_paths [*paths, *submenu_paths] end
has_path?(path)
click to toggle source
# File lib/menu_maker/menu.rb, line 107 def has_path?(path) all_paths.include? Path::Converter.convert(path) end
method_missing(method, *args)
click to toggle source
# File lib/menu_maker/menu.rb, line 111 def method_missing(method, *args) options && options[method] || '' end
path()
click to toggle source
# File lib/menu_maker/menu.rb, line 119 def path @paths.first.path end
paths()
click to toggle source
# File lib/menu_maker/menu.rb, line 91 def paths @paths end
respond_to_missing?(method)
click to toggle source
# File lib/menu_maker/menu.rb, line 115 def respond_to_missing?(method) !!(options && options[method]) end
to_s()
click to toggle source
# File lib/menu_maker/menu.rb, line 127 def to_s title end