Module: Middleman::CoreExtensions::Request::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#map(map, &block)

This method returns an undefined value.

Add Rack App mapped to specific path

Parameters:

  • map (String)

    Path to map



119
120
121
122
# File 'lib/middleman-core/core_extensions/request.rb', line 119

def map(map, &block)
  @mappings ||= []
  @mappings << [map, block]
end

#use(middleware, *args, &block)

This method returns an undefined value.

Use Rack middleware

Parameters:

  • middleware (Class)

    Middleware module



110
111
112
113
# File 'lib/middleman-core/core_extensions/request.rb', line 110

def use(middleware, *args, &block)
  @middleware ||= []
  @middleware << [middleware, args, block]
end