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

#adapterSymbol

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

#adapter_optionsHash

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

#ipString

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

#portFixnum

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

.defaultConfiguration

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