Class: RubyApp::Application
- Inherits:
-
Object
- Object
- RubyApp::Application
- Extended by:
- Mixins::DelegateMixin
- Includes:
- Mixins::ConfigureMixin
- Defined in:
- lib/ruby_app/application.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Application
constructor
A new instance of Application.
- #start! ⇒ Object
- #stop! ⇒ Object
Methods included from Mixins::DelegateMixin
Methods included from Mixins::ConfigureMixin
Constructor Details
#initialize(options) ⇒ Application
Returns a new instance of Application.
16 17 18 19 |
# File 'lib/ruby_app/application.rb', line 16 def initialize() @options = @environment = {} end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
14 15 16 |
# File 'lib/ruby_app/application.rb', line 14 def environment @environment end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/ruby_app/application.rb', line 14 def @options end |
Class Method Details
.create!(options = {}) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/ruby_app/application.rb', line 35 def self.create!( = {}) = { :application_class => RubyApp::Application, :session_class => RubyApp::Session, :log_path => File.join(RubyApp::ROOT, %w[log application.log]), :configuration_paths => [], :default_language => :en, :translations_paths => [] }.merge() .configuration_paths = [File.join(RubyApp::ROOT, %w[config.yml])] + ( .configuration_paths.is_a?(Array) ? .configuration_paths : [.configuration_paths] ) .translations_paths = [File.join(RubyApp::ROOT, %w[translations])] + ( .translations_paths.is_a?(Array) ? .translations_paths : [.translations_paths] ) @@_application = .application_class.new() @@_application.start! RubyApp::Log.debug("#{self}##{__method__} options=#{.inspect}") end |
.destroy! ⇒ Object
49 50 51 52 53 |
# File 'lib/ruby_app/application.rb', line 49 def self.destroy! RubyApp::Log.debug("#{self}##{__method__}") @@_application.stop! @@_application = nil end |
.get ⇒ Object
31 32 33 |
# File 'lib/ruby_app/application.rb', line 31 def self.get @@_application ||= nil end |