Class: QemuToolkit::Config
- Inherits:
-
Object
- Object
- QemuToolkit::Config
- Defined in:
- lib/qemu-toolkit/config.rb
Overview
A configuration class that acts as a singleton, but really isn’t. This allows for a mixed style of coding, either using QemuToolkit::Config as an instance or as a class.
Instance Attribute Summary collapse
Class Method Summary collapse
- .current ⇒ Object
- .method_missing(sym, *args, &block) ⇒ Object
- .reset ⇒ Object
- .respond_to?(sym) ⇒ Boolean
Instance Method Summary collapse
-
#backend ⇒ Object
The command runner backend for all commands.
Instance Attribute Details
#etc(*args) ⇒ Object
28 29 30 |
# File 'lib/qemu-toolkit/config.rb', line 28 def etc(*args) (@etc, *args) end |
#var_run(*args) ⇒ Object
31 32 33 |
# File 'lib/qemu-toolkit/config.rb', line 31 def var_run(*args) (@var_run, *args) end |
Class Method Details
.current ⇒ Object
17 18 19 |
# File 'lib/qemu-toolkit/config.rb', line 17 def current @current ||= new end |
.method_missing(sym, *args, &block) ⇒ Object
9 10 11 12 |
# File 'lib/qemu-toolkit/config.rb', line 9 def method_missing(sym, *args, &block) return current.send(sym, *args, &block) if current.respond_to?(sym) super end |
.reset ⇒ Object
20 21 22 |
# File 'lib/qemu-toolkit/config.rb', line 20 def reset @current = nil end |
.respond_to?(sym) ⇒ Boolean
13 14 15 |
# File 'lib/qemu-toolkit/config.rb', line 13 def respond_to?(sym) current.respond_to?(sym) || super end |