Module: Shoes::Common::Registration

Included in:
Shoes, Swt
Defined in:
shoes-core/lib/shoes/common/registration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#main_appObject (readonly)

Returns the value of attribute main_app


25
26
27
# File 'shoes-core/lib/shoes/common/registration.rb', line 25

def main_app
  @main_app
end

Instance Method Details

#appsObject


6
7
8
9
# File 'shoes-core/lib/shoes/common/registration.rb', line 6

def apps
  @apps ||= []
  @apps.dup
end

#register(app) ⇒ Object


11
12
13
14
# File 'shoes-core/lib/shoes/common/registration.rb', line 11

def register(app)
  register_main_app app
  apps && @apps << app
end

#register_main_app(app) ⇒ Object

Registers the first app as the main app


28
29
30
# File 'shoes-core/lib/shoes/common/registration.rb', line 28

def register_main_app(app)
  @main_app ||= app
end

#unregister(app) ⇒ Object


16
17
18
# File 'shoes-core/lib/shoes/common/registration.rb', line 16

def unregister(app)
  apps && @apps.delete(app)
end

#unregister_allObject


20
21
22
23
# File 'shoes-core/lib/shoes/common/registration.rb', line 20

def unregister_all
  @main_app = nil
  @apps = []
end