Class: KO::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/ko/application.rb

Instance Attribute Summary

Attributes inherited from Object

#id, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Object

[], #[], #_, #add_child, #app, #children, #inspect, #remove_child

Methods included from Signals

extended, #inherited, #signals

Methods included from Properties

extended, #property

Constructor Details

#initialize(id: nil, parent: nil) ⇒ Application

Returns a new instance of Application.

Raises:



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

.instanceObject



7
# File 'lib/ko/application.rb', line 7

def instance = $_KO_APP

Instance Method Details

#parent=(_obj) ⇒ Object

rubocop:enable Style/GlobalVars

Raises:



22
23
24
# File 'lib/ko/application.rb', line 22

def parent=(_obj)
  raise KO::InvalidParent, "KO::Application cannot have a parent"
end