Module: Middleman::CoreExtensions::Request::ServerMethods

Defined in:
lib/middleman-core/core_extensions/request.rb

Instance Method Summary collapse

Instance Method Details

#server(&block) ⇒ Class

Create a new Class which is based on Middleman::Application Used to create a safe sandbox into which extensions and configuration can be included later without impacting other classes and instances.

Returns:

  • (Class)


133
134
135
136
137
# File 'lib/middleman-core/core_extensions/request.rb', line 133

def server(&block)
  @@servercounter ||= 0
  @@servercounter += 1
  const_set("MiddlemanApplication#{@@servercounter}", Class.new(Middleman::Application))
end