Module: Pepito::Handler::HTTPRouter

Included in:
Pepito::Handler
Defined in:
lib/pepito/handler/http_router.rb

Overview

Routes for the http api

Instance Method Summary collapse

Instance Method Details

#http_route(method, path, cb) ⇒ void

This method returns an undefined value.

Add an http route to the http_routes array.

Parameters:

  • method (String)

    HTTP method for this route. Example: “GET”.

  • path (String)

    Path for the http api. Example: “/info”.

  • cb (Symbol)

    Callback function.



14
15
16
17
18
19
20
21
# File 'lib/pepito/handler/http_router.rb', line 14

def http_route(method, path, cb)
  http_routes << HTTPApi::HTTPRoute.new(
    @robot,
    self,
    method,
    path,
    cb)
end

#http_routesArray<Pepito::HTTPApi::HTTPRoute>

List of http routes.

Returns:



25
26
27
# File 'lib/pepito/handler/http_router.rb', line 25

def http_routes
  @http_routes ||= []
end