Module: Tgui::WidgetOwner
- Extended by:
- BangDef
- Defined in:
- lib/white_gold/convention/container_widgets.rb
Constant Summary collapse
"Button0"
Instance Method Summary collapse
- #child_methods ⇒ Object
- #common_widget_nest(widget, *keys, id: nil, **na, &b) ⇒ Object
- #equip_child_widget(widget) ⇒ Object
Methods included from BangDef
Instance Method Details
#child_methods ⇒ Object
78 79 80 81 |
# File 'lib/white_gold/convention/container_widgets.rb', line 78 def child_methods ## TO OPTIMIZE methods.filter{ _1.start_with? ApiChild::API_CHILD_PREFIX } end |
#common_widget_nest(widget, *keys, id: nil, **na, &b) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/white_gold/convention/container_widgets.rb', line 50 def , *keys, id: nil, **na, &b club_params = {} Enumerator.new do |e| cl = .class while cl != Object e << cl cl = cl.superclass end e << Object end.to_a.reverse!.each do |key| if key == .class club = page.club key club.join id if id else club = page.club key, create_on_missing: false end club_params.merge! club.params if club end keys.each do |key| club = page.club key club.join id if id club_params.merge! club.params end upon! , **club_params, **na, &b end |
#equip_child_widget(widget) ⇒ Object
83 84 85 86 87 88 89 90 91 92 |
# File 'lib/white_gold/convention/container_widgets.rb', line 83 def .page = page parent = self child_methods.each do |method| .define_singleton_method method[ApiChild::API_CHILD_PREFIX.length..] do |*a| parent.send(method, self, *a) end end end |