Class: Lita::HTTPRoute

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

Overview

Handlers use this class to define HTTP routes for the built-in web server.

Constant Summary collapse

ExtendedRoute =

An HttpRouter::Route class used for dispatch.

Since:

  • 3.0.0

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(handler_class) ⇒ HTTPRoute


31
32
33
# File 'lib/lita/http_route.rb', line 31

def initialize(handler_class)
  @handler_class = handler_class
end

Instance Attribute Details

#handler_classLita::Handler (readonly)

The handler registering the route.


28
29
30
# File 'lib/lita/http_route.rb', line 28

def handler_class
  @handler_class
end

Instance Method Details

#delete(path, method_name, options = {}) ⇒ void #delete(path, options = {}) { ... } ⇒ void

Overloads:

  • #delete(path, method_name, options = {}) ⇒ void

    This method returns an undefined value.

    Defines a new route with the “delete” HTTP method.

  • #delete(path, options = {}) { ... } ⇒ void

    This method returns an undefined value.

    Defines a new route with the “delete” HTTP method.

    Yields:

    • The body of the route's callback.

    Since:

    • 4.0.0


65
# File 'lib/lita/http_route.rb', line 65

define_http_method :delete

#get(path, method_name, options = {}) ⇒ void #get(path, options = {}) { ... } ⇒ void

Overloads:

  • #get(path, method_name, options = {}) ⇒ void

    This method returns an undefined value.

    Defines a new route with the “get” HTTP method.

  • #get(path, options = {}) { ... } ⇒ void

    This method returns an undefined value.

    Defines a new route with the “get” HTTP method.

    Yields:

    • The body of the route's callback.

    Since:

    • 4.0.0


61
# File 'lib/lita/http_route.rb', line 61

define_http_method :get

#head(path, method_name, options = {}) ⇒ void #head(path, options = {}) { ... } ⇒ void

Overloads:

  • #head(path, method_name, options = {}) ⇒ void

    This method returns an undefined value.

    Defines a new route with the “head” HTTP method.

  • #head(path, options = {}) { ... } ⇒ void

    This method returns an undefined value.

    Defines a new route with the “head” HTTP method.

    Yields:

    • The body of the route's callback.

    Since:

    • 4.0.0


60
# File 'lib/lita/http_route.rb', line 60

define_http_method :head

Overloads:

  • #link(path, method_name, options = {}) ⇒ void

    This method returns an undefined value.

    Defines a new route with the “link” HTTP method.

  • #link(path, options = {}) { ... } ⇒ void

    This method returns an undefined value.

    Defines a new route with the “link” HTTP method.

    Yields:

    • The body of the route's callback.

    Since:

    • 4.0.0


67
# File 'lib/lita/http_route.rb', line 67

define_http_method :link

#options(path, method_name, options = {}) ⇒ void #options(path, options = {}) { ... } ⇒ void

Overloads:

  • #options(path, method_name, options = {}) ⇒ void

    This method returns an undefined value.

    Defines a new route with the “options” HTTP method.

  • #options(path, options = {}) { ... } ⇒ void

    This method returns an undefined value.

    Defines a new route with the “options” HTTP method.

    Yields:

    • The body of the route's callback.

    Since:

    • 4.0.0


66
# File 'lib/lita/http_route.rb', line 66

define_http_method :options

#patch(path, method_name, options = {}) ⇒ void #patch(path, options = {}) { ... } ⇒ void

Overloads:

  • #patch(path, method_name, options = {}) ⇒ void

    This method returns an undefined value.

    Defines a new route with the “patch” HTTP method.

  • #patch(path, options = {}) { ... } ⇒ void

    This method returns an undefined value.

    Defines a new route with the “patch” HTTP method.

    Yields:

    • The body of the route's callback.

    Since:

    • 4.0.0


64
# File 'lib/lita/http_route.rb', line 64

define_http_method :patch

#post(path, method_name, options = {}) ⇒ void #post(path, options = {}) { ... } ⇒ void

Overloads:

  • #post(path, method_name, options = {}) ⇒ void

    This method returns an undefined value.

    Defines a new route with the “post” HTTP method.

  • #post(path, options = {}) { ... } ⇒ void

    This method returns an undefined value.

    Defines a new route with the “post” HTTP method.

    Yields:

    • The body of the route's callback.

    Since:

    • 4.0.0


62
# File 'lib/lita/http_route.rb', line 62

define_http_method :post

#put(path, method_name, options = {}) ⇒ void #put(path, options = {}) { ... } ⇒ void

Overloads:

  • #put(path, method_name, options = {}) ⇒ void

    This method returns an undefined value.

    Defines a new route with the “put” HTTP method.

  • #put(path, options = {}) { ... } ⇒ void

    This method returns an undefined value.

    Defines a new route with the “put” HTTP method.

    Yields:

    • The body of the route's callback.

    Since:

    • 4.0.0


63
# File 'lib/lita/http_route.rb', line 63

define_http_method :put

Overloads:

  • #unlink(path, method_name, options = {}) ⇒ void

    This method returns an undefined value.

    Defines a new route with the “unlink” HTTP method.

  • #unlink(path, options = {}) { ... } ⇒ void

    This method returns an undefined value.

    Defines a new route with the “unlink” HTTP method.

    Yields:

    • The body of the route's callback.

    Since:

    • 4.0.0


68
# File 'lib/lita/http_route.rb', line 68

define_http_method :unlink