Class: Rapid::Server::App

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/ury_rapid/server/app.rb

Overview

The Sinatra application that powers the server component of Rapid

Much of the functionality of the Sinatra app is held in separate helper and routing modules. See Rapid::Server::Helpers and Rapid::Server::Routing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, environment) ⇒ App


21
22
23
24
25
26
27
28
29
30
31
# File 'lib/ury_rapid/server/app.rb', line 21

def initialize(config, environment)
  super()

  fail(ArgumentError, 'Need an environment.') if environment.nil?

  @environment = environment
  @config      = config

  rd_key = :root_directory
  settings.set :root, config[rd_key] if config.key?(rd_key)
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment


33
34
35
# File 'lib/ury_rapid/server/app.rb', line 33

def environment
  @environment
end