Module: Lita::Handler::HTTPRouter

Included in:
Lita::Handler
Defined in:
lib/lita/handler/http_router.rb

Overview

A handler mixin that provides the methods necessary for handling incoming HTTP requests.

Since:

  • 4.0.0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(klass) ⇒ Object

Includes common handler methods in any class that includes Lita::Handler::HTTPRouter.

Since:

  • 4.0.0



7
8
9
# File 'lib/lita/handler/http_router.rb', line 7

def self.extended(klass)
  klass.send(:include, Common)
end

Instance Method Details

#httpLita::HTTPRoute

Creates a new Lita::HTTPRoute which is used to define an HTTP route for the built-in web server.

Returns:

See Also:

Since:

  • 4.0.0



15
16
17
# File 'lib/lita/handler/http_router.rb', line 15

def http
  HTTPRoute.new(self)
end

#http_routesArray<Lita::HTTPRoute>

An array of all HTTP routes defined for the handler.

Returns:

Since:

  • 4.0.0



21
22
23
# File 'lib/lita/handler/http_router.rb', line 21

def http_routes
  @http_routes ||= []
end