Class: Tinker::Engine

Inherits:
Object
  • Object
show all
Includes:
Singleton, Context
Defined in:
lib/tinker/engine.rb

Direct Known Subclasses

Application

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Context

contexts, included

Methods included from Evented

#dispatch, #every, #on

Constructor Details

#initializeEngine

Returns a new instance of Engine.



7
8
9
# File 'lib/tinker/engine.rb', line 7

def initialize
  super
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



5
6
7
# File 'lib/tinker/engine.rb', line 5

def config
  @config
end

Class Method Details

.configureObject



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_singletonObject



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