Class: Waves::Configurations::Default

Inherits:
Base show all
Defined in:
lib/runtime/configuration.rb

Overview

The Default configuration provides a good starting point for your applications, defining a number of attributes that are required by Waves.

Class Method Summary collapse

Methods inherited from Base

[], []=, attribute

Class Method Details

.application(&block) ⇒ Object

Defines the application for use with Rack.



164
165
166
167
168
169
170
# File 'lib/runtime/configuration.rb', line 164

def self.application( &block )
  if block_given?
    self['application'] = Rack::Builder.new( &block )
  else
    self['application']
  end
end

.handler(*args) ⇒ Object

Set the handler for use with Rack, along with any handler-specific options that will be passed to the handler’s #run method. When accessing the value (calling with no arguments) returns an array of the handler and options.



149
150
151
152
153
154
155
# File 'lib/runtime/configuration.rb', line 149

def self.handler(*args)
  if args.length > 0
    @rack_handler, @rack_handler_options = args
  else
    [ @rack_handler, @rack_handler_options ]
  end
end

.mime_typesObject

Provide access to the Waves::MimeTypes class via the configuration. You could potentially point this to your own MIME types repository class.



159
160
161
# File 'lib/runtime/configuration.rb', line 159

def self.mime_types
  Waves::MimeTypes
end