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



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

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

.color(color = nil) ⇒ Object

COLOR



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

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

.sub(name) ⇒ Object



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

def self.sub 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



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

def self.system
  self
end

.tokenObject



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

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