Module: Shoes::Common::Registration
Instance Attribute Summary collapse
-
#main_app ⇒ Object
readonly
Returns the value of attribute main_app.
Instance Method Summary collapse
- #apps ⇒ Object
- #register(app) ⇒ Object
-
#register_main_app(app) ⇒ Object
Registers the first app as the main app.
- #unregister(app) ⇒ Object
- #unregister_all ⇒ Object
Instance Attribute Details
#main_app ⇒ Object (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
#apps ⇒ Object
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_all ⇒ Object
20 21 22 23 |
# File 'shoes-core/lib/shoes/common/registration.rb', line 20 def unregister_all @main_app = nil @apps = [] end |