Module: RuoteKit
- Defined in:
- lib/ruote-kit/version.rb,
lib/ruote-kit.rb,
lib/ruote-kit/application.rb,
lib/ruote-kit/helpers/json_helpers.rb,
lib/ruote-kit/helpers/link_helpers.rb,
lib/ruote-kit/helpers/misc_helpers.rb,
lib/ruote-kit/helpers/render_helpers.rb,
lib/ruote-kit/helpers/pagination_helpers.rb
Overview
license is MIT, see LICENSE.txt
Defined Under Namespace
Modules: Helpers Classes: Application
Constant Summary collapse
- VERSION =
'2.2.0'
Class Attribute Summary collapse
-
.engine ⇒ Object
Returns the value of attribute engine.
Class Method Summary collapse
-
.bind_engine(storage) ⇒ Object
Uses the given storage for the RuoteKit.engine (no worker running here).
- .env ⇒ Object
-
.run_worker(storage, join = true) ⇒ Object
Given a storage, runs a worker and sets RuoteKit.engine accordingly.
-
.storage_participant ⇒ Object
Returns the storage participant associated automatically with any storage.
Class Attribute Details
.engine ⇒ Object
Returns the value of attribute engine.
18 19 20 |
# File 'lib/ruote-kit.rb', line 18 def engine @engine end |
Class Method Details
.bind_engine(storage) ⇒ Object
Uses the given storage for the RuoteKit.engine (no worker running here).
43 44 45 |
# File 'lib/ruote-kit.rb', line 43 def bind_engine(storage) RuoteKit.engine = Ruote::Engine.new(storage) end |
.env ⇒ Object
20 21 22 |
# File 'lib/ruote-kit.rb', line 20 def env @env ||= defined?(Rails) ? Rails.env : ENV['RACK_ENV'] || 'development' end |
.run_worker(storage, join = true) ⇒ Object
Given a storage, runs a worker and sets RuoteKit.engine accordingly.
By default, this method won’t return (it will ‘join’ the worker). If you need to go on after this call, pass false as second parameter (especially useful in an EventMachine setting).
36 37 38 39 |
# File 'lib/ruote-kit.rb', line 36 def run_worker(storage, join=true) RuoteKit.engine = Ruote::Engine.new( Ruote::Worker.new(storage), :join => join) end |
.storage_participant ⇒ Object
Returns the storage participant associated automatically with any storage
26 27 28 |
# File 'lib/ruote-kit.rb', line 26 def storage_participant engine.storage_participant end |