Class: Webmachine::Configuration

Inherits:
Struct
  • Object
show all
Defined in:
lib/webmachine/configuration.rb

Overview

A simple configuration container for items that are used across multiple web server adapters. Typically set using configure. If not set by your application, the defaults will be filled in when run is called.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Attribute Details

- (Symbol) adapter

the adapter to use, defaults to :WEBrick



11
12
13
# File 'lib/webmachine/configuration.rb', line 11

def adapter
  @adapter
end

- (Hash) adapter_options

adapter-specific options, defaults to {}



11
12
13
# File 'lib/webmachine/configuration.rb', line 11

def adapter_options
  @adapter_options
end

- (String) ip

the interface to bind to, defaults to “0.0.0.0” (all interfaces)



11
12
13
# File 'lib/webmachine/configuration.rb', line 11

def ip
  @ip
end

- (Fixnum) port

the port to bind to, defaults to 8080



11
12
13
# File 'lib/webmachine/configuration.rb', line 11

def port
  @port
end

Class Method Details

+ (Configuration) default



14
15
16
# File 'lib/webmachine/configuration.rb', line 14

def Configuration.default
  new("0.0.0.0", 8080, :WEBrick, {})
end