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

Returns:

  • (Symbol)

    the current value of adapter



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

def adapter
  @adapter
end

- (Hash) adapter_options

adapter-specific options, defaults to {}

Returns:

  • (Hash)

    the current value of adapter_options



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)

Returns:

  • (String)

    the current value of ip



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

def ip
  @ip
end

- (Fixnum) port

the port to bind to, defaults to 8080

Returns:

  • (Fixnum)

    the current value of port



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

def port
  @port
end

Class Method Details

+ (Configuration) default

Returns the default configuration

Returns:



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

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