Class: Tinker::Engine
- Inherits:
-
Object
- Object
- Tinker::Engine
- Includes:
- Singleton, Context
- Defined in:
- lib/tinker/engine.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Engine
constructor
A new instance of Engine.
Methods included from Context
Methods included from Evented
Constructor Details
#initialize ⇒ Engine
Returns a new instance of Engine.
7 8 9 |
# File 'lib/tinker/engine.rb', line 7 def initialize super end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
5 6 7 |
# File 'lib/tinker/engine.rb', line 5 def config @config end |
Class Method Details
.configure ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/tinker/engine.rb', line 11 def self.configure @singleton__mutex__.synchronize { app = self.send(:allocate) app.config = Configuration.new yield app.config if block_given? @singleton__instance__ = app } end |
.release_singleton ⇒ Object
20 21 22 23 24 25 |
# File 'lib/tinker/engine.rb', line 20 def self.release_singleton @singleton__mutex__.synchronize { @singleton__instance__ = nil } self end |