Class: Pepito::HTTPApi::HTTPRoute

Inherits:
Object
  • Object
show all
Defined in:
lib/pepito/http_api/http_route.rb

Overview

The http route object.

Constant Summary collapse

ExtendedRoute =

Class to extends the HttpRouter route

Class.new(HttpRouter::Route) do
  include HttpRouter::RouteHelper
  include HttpRouter::GenerationHelper
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(robot, klass, method, path, func) ⇒ void

Parameters:

  • robot (Pepito::Robot)

    The currently running robot.

  • klass (Pepito::Handler)

    The class to call the function from.

  • method (String)

    The http method (Example: “GET”).

  • path (String)

    The path for the route.

  • func (Symbol)

    The function to call.



25
26
27
# File 'lib/pepito/http_api/http_route.rb', line 25

def initialize(robot, klass, method, path, func)
  @route = setup_route(robot, klass, method, path, func)
end

Instance Attribute Details

#routeExtendedRoute (readonly)

The route object.

Returns:



17
18
19
# File 'lib/pepito/http_api/http_route.rb', line 17

def route
  @route
end