Class: Liza::Controller

Inherits:
Unit
  • Object
show all
Defined in:
lib/liza/base/controller.rb

Class Method Summary collapse

Methods inherited from Unit

const_missing, division, part, system, #system, test_class

Class Method Details

.colorObject

color



21
22
23
24
# File 'lib/liza/base/controller.rb', line 21

def self.color
  return system.color if subsystem?
  subsystem.color
end

.inherited(klass) ⇒ Object



13
14
15
16
17
# File 'lib/liza/base/controller.rb', line 13

def self.inherited klass
  super

  klass.on_connected if klass.superclass == Liza::Controller
end

.on_connectedObject



5
6
7
8
9
10
11
# File 'lib/liza/base/controller.rb', line 5

def self.on_connected
  token = self.last_namespace.snakecase.to_sym
  panel = system.const("#{token}_panel").new name

  subsystem! system.box, panel
  division!
end