Module: MenuBarEnumerable

Includes:
Enumerable
Defined in:
lib/xrc_pepper.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object

find a menu_item in any of the bar’s menu



52
53
54
55
56
57
58
# File 'lib/xrc_pepper.rb', line 52

def method_missing(name, *args)
  each do |menu|
    item = menu.find_item_by_name(name)
    return item if item
  end
  super
end

Instance Method Details

#eachObject



43
44
45
46
47
48
49
# File 'lib/xrc_pepper.rb', line 43

def each
  index = 0
  while index < get_menu_count
    yield get_menu(index)
    index += 1
  end
end