Class: KO::Application
Instance Attribute Summary
Attributes inherited from Object
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id: nil, parent: nil) ⇒ Application
constructor
A new instance of Application.
-
#parent=(_obj) ⇒ Object
rubocop:enable Style/GlobalVars.
Methods inherited from Object
[], #[], #_, #add_child, #app, #children, #inspect, #remove_child
Methods included from Signals
extended, #inherited, #signals
Methods included from Properties
Constructor Details
#initialize(id: nil, parent: nil) ⇒ Application
Returns a new instance of Application.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ko/application.rb', line 10 def initialize(id: nil, parent: nil) begin super(id: id || "app", parent:) rescue InvalidParent @parent = nil end raise AlreadyIitialized if $_KO_APP $_KO_APP = self end |
Class Method Details
.instance ⇒ Object
7 |
# File 'lib/ko/application.rb', line 7 def instance = $_KO_APP |
Instance Method Details
#parent=(_obj) ⇒ Object
rubocop:enable Style/GlobalVars
22 23 24 |
# File 'lib/ko/application.rb', line 22 def parent=(_obj) raise KO::InvalidParent, "KO::Application cannot have a parent" end |