Class: Moon::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/moon/application.rb

Overview

Main application class.

Defined Under Namespace

Classes: Configuration, InvalidActionError, InvalidResponseError, Rack

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApplication

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

#configurationObject (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

#environmentObject



30
31
32
# File 'lib/moon/application.rb', line 30

def environment
  @rack.environment
end

#rackObject



26
27
28
# File 'lib/moon/application.rb', line 26

def rack
  @rack.transponder
end

#storage_nameObject



34
35
36
# File 'lib/moon/application.rb', line 34

def storage_name
  @rack.environment == :test ? :dump : :main
end