Class: Moon::Application
- Inherits:
-
Object
- Object
- Moon::Application
- Defined in:
- lib/moon/application.rb
Overview
Main application class.
Defined Under Namespace
Classes: Configuration, InvalidActionError, InvalidResponseError, Rack
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #configure(&block) ⇒ Object
- #environment ⇒ Object
-
#initialize ⇒ Application
constructor
A new instance of Application.
- #rack ⇒ Object
- #storage_name ⇒ Object
Constructor Details
#initialize ⇒ Application
Returns a new instance of Application.
16 17 18 |
# File 'lib/moon/application.rb', line 16 def initialize @rack = Rack.new self end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
14 15 16 |
# File 'lib/moon/application.rb', line 14 def configuration @configuration end |
Instance Method Details
#configure(&block) ⇒ Object
20 21 22 23 24 |
# File 'lib/moon/application.rb', line 20 def configure(&block) @configuration = Configuration.new &block @rack.session = @configuration.session @rack.routes = @configuration.routes end |
#environment ⇒ Object
30 31 32 |
# File 'lib/moon/application.rb', line 30 def environment @rack.environment end |
#rack ⇒ Object
26 27 28 |
# File 'lib/moon/application.rb', line 26 def rack @rack.transponder end |
#storage_name ⇒ Object
34 35 36 |
# File 'lib/moon/application.rb', line 34 def storage_name @rack.environment == :test ? :dump : :main end |