Class: Liza::Unit
- Inherits:
-
Object
- Object
- Liza::Unit
- Defined in:
- lib/liza/unit.rb
Defined Under Namespace
Classes: Error, RenderError, RenderStackIsEmpty, RenderStackIsFull, RendererNotFound
Class Method Summary collapse
- .const_missing(name) ⇒ Object
-
.division ⇒ Object
CONTROLLER.
-
.part(key, klass = nil, system: nil) ⇒ Object
PART.
-
.system ⇒ Object
SYSTEM.
-
.test_class ⇒ Object
TEST.
Instance Method Summary collapse
Class Method Details
.const_missing(name) ⇒ Object
17 18 19 20 21 |
# File 'lib/liza/unit.rb', line 17 def self.const_missing name Liza.const name rescue Liza::ConstNotFound raise NameError, "uninitialized constant #{name}", caller[1..], cause: nil end |
.division ⇒ Object
CONTROLLER
64 65 66 |
# File 'lib/liza/unit.rb', line 64 def self.division Liza::Controller end |
.part(key, klass = nil, system: nil) ⇒ Object
PART
9 10 11 |
# File 'lib/liza/unit.rb', line 9 def self.part key, klass = nil, system: nil Lizarb.connect_part self, key, klass, system end |
.system ⇒ Object
SYSTEM
70 71 72 73 74 75 76 77 |
# File 'lib/liza/unit.rb', line 70 def self.system if name&.include? "::" return System if first_namespace == "Liza" Object.const_get first_namespace else superclass.system end end |
.test_class ⇒ Object
TEST
53 54 55 56 57 58 59 60 |
# File 'lib/liza/unit.rb', line 53 def self.test_class @test_class ||= if first_namespace == "Liza" Liza.const_get "#{last_namespace}Test" else Object.const_get "#{name}Test" end end |
Instance Method Details
#system ⇒ Object
81 82 83 |
# File 'lib/liza/unit.rb', line 81 def system self.class.system end |