Class: Waves::Configurations::Default
- 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
-
.application(&block) ⇒ Object
Defines the application for use with Rack.
-
.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.
-
.mime_types ⇒ Object
Provide access to the Waves::MimeTypes class via the configuration.
Methods inherited from Base
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 |