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



116
117
118
119
# File 'lib/middleman-core/core_extensions/request.rb', line 116

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



107
108
109
110
# File 'lib/middleman-core/core_extensions/request.rb', line 107

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