Class: Rubel::Runtime::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/rubel/runtime/loader.rb

Overview

Loader determines which runtime to load, based on RAILS_ENV. For production and test environment uses Sandbox. In all other cases Console

Examples:


Rubel::Runtime::Loader.runtime.new  

For your own Runtime class


class MyRuntime < Rubel::Runtime::Loader.runtime
  include ::Rubel::Core
end

Class Method Summary collapse

Class Method Details

.runtimeObject



19
20
21
22
23
24
25
26
# File 'lib/rubel/runtime/loader.rb', line 19

def self.runtime
  case ENV['RAILS_ENV']
  when 'production'  then ::Rubel::Runtime::Sandbox
  when 'test'        then ::Rubel::Runtime::Sandbox
  when 'development' then ::Rubel::Runtime::Console
  else ::Rubel::Runtime::Console
  end
end