Class: Liza::System

Inherits:
Unit
  • Object
show all
Defined in:
lib/liza/meta/system.rb

Class Method Summary collapse

Methods inherited from Unit

const_missing, division, part, #system, test_class

Class Method Details

.boxObject



42
43
44
# File 'lib/liza/meta/system.rb', line 42

def self.box
  @box ||= self.const_get "#{token}_box".camelize
end

.color(color = nil) ⇒ Object

COLOR



54
55
56
57
58
59
60
# File 'lib/liza/meta/system.rb', line 54

def self.color color = nil
  if color
    @color = color
  else
    @color
  end
end

.const(name) ⇒ Object



3
4
5
# File 'lib/liza/meta/system.rb', line 3

def self.const name
  const_get name.to_s.camelize
end

.panel(name) ⇒ Object

Adds a subsystem to the system



34
35
36
# File 'lib/liza/meta/system.rb', line 34

def self.panel name
  subs << name
end

.subsObject



25
26
27
# File 'lib/liza/meta/system.rb', line 25

def self.subs
  @subs ||= []
end

.subsystemsObject



29
30
31
# File 'lib/liza/meta/system.rb', line 29

def self.subsystems
  @subsystems ||= subs.map { const _1 }
end

.systemObject

SYSTEM



48
49
50
# File 'lib/liza/meta/system.rb', line 48

def self.system
  self
end

.tokenObject



38
39
40
# File 'lib/liza/meta/system.rb', line 38

def self.token
  @token ||= name.gsub(/System$/, '').snakecase.to_sym
end