Class: Liza::Box

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

Class Method Summary collapse

Methods inherited from Unit

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

Class Method Details

.[](symbol) ⇒ Object



7
8
9
# File 'lib/liza/meta/box.rb', line 7

def self.[] symbol
  panels[symbol].started
end

.colorObject

color



21
22
23
# File 'lib/liza/meta/box.rb', line 21

def self.color
  system.color
end

.configure(name, &block) ⇒ Object

Raises:

  • (ArgumentError)


11
12
13
14
15
16
17
# File 'lib/liza/meta/box.rb', line 11

def self.configure name, &block
  raise ArgumentError, "block required" unless block_given?
  raise ArgumentError, "Invalid panel: #{name}. Valid panels are: #{system.subs}" unless system.subs.include? name

  panel = panels[name] ||= Liza.const("#{name}_panel").new name
  panel.push block
end

.panelsObject



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

def self.panels
  fetch(:panels) { {} }
end