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



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

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



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

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