Class: Liza::Panel
Direct Known Subclasses
DevSystem::BenchPanel, DevSystem::CommandPanel, DevSystem::GeneratorPanel, DevSystem::LogPanel, DevSystem::ShellPanel, HappySystem::AxoPanel, NetSystem::ClientPanel, NetSystem::DatabasePanel, NetSystem::RecordPanel, WebSystem::RackPanel, WebSystem::RequestPanel
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Unit
const_missing, part, #system, system, test_class
Constructor Details
#initialize(key) ⇒ Panel
Returns a new instance of Panel.
60
61
62
63
64
65
|
# File 'lib/liza/base/panel.rb', line 60
def initialize key
@key = key
@blocks = []
@unstarted = true
@short = {}
end
|
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
58
59
60
|
# File 'lib/liza/base/panel.rb', line 58
def key
@key
end
|
Class Method Details
.box ⇒ Object
14
15
16
|
# File 'lib/liza/base/panel.rb', line 14
def self.box
system.box
end
|
.color ⇒ Object
52
53
54
|
# File 'lib/liza/base/panel.rb', line 52
def self.color
system.color
end
|
.controller ⇒ Object
22
23
24
|
# File 'lib/liza/base/panel.rb', line 22
def self.controller
@controller ||= system.const token
end
|
.division ⇒ Object
30
31
32
|
# File 'lib/liza/base/panel.rb', line 30
def self.division
controller.division
end
|
.subsystem ⇒ Object
42
43
44
|
# File 'lib/liza/base/panel.rb', line 42
def self.subsystem
controller
end
|
.token ⇒ Object
38
39
40
|
# File 'lib/liza/base/panel.rb', line 38
def self.token
@token ||= last_namespace.gsub(/Panel$/, '').snakecase.to_sym
end
|
Instance Method Details
#box ⇒ Object
18
19
20
|
# File 'lib/liza/base/panel.rb', line 18
def box
system.box
end
|
#controller ⇒ Object
26
27
28
|
# File 'lib/liza/base/panel.rb', line 26
def controller
self.class.controller
end
|
#division ⇒ Object
34
35
36
|
# File 'lib/liza/base/panel.rb', line 34
def division
controller.division
end
|
#push(block) ⇒ Object
79
80
81
82
|
# File 'lib/liza/base/panel.rb', line 79
def push block
@unstarted = true
@blocks.push block
end
|
#short(a, b = nil) ⇒ Object
69
70
71
72
73
74
75
|
# File 'lib/liza/base/panel.rb', line 69
def short a, b = nil
if b
@short[a.to_s] = b.to_s
else
@short[a.to_s] || a.to_s
end
end
|
#started ⇒ Object
84
85
86
87
88
89
90
91
92
|
# File 'lib/liza/base/panel.rb', line 84
def started
return self unless defined? @unstarted
remove_instance_variable :@unstarted
@blocks.each { |bl| instance_eval(&bl) }
@blocks.clear
self
end
|
#subsystem ⇒ Object
46
47
48
|
# File 'lib/liza/base/panel.rb', line 46
def subsystem
controller
end
|