Class: Landline::Handlers::GET

Inherits:
Handler show all
Defined in:
lib/landline/probe/http_method.rb

Overview

Probe that executes callback on a GET

Direct Known Subclasses

CONNECT, DELETE, HEAD, OPTIONS, PATCH, POST, PUT, TRACE

Constant Summary collapse

METHOD =
"GET"

Instance Attribute Summary

Attributes inherited from Probe

#properties

Attributes inherited from Node

#remap, #root

Instance Method Summary collapse

Methods inherited from Handler

#initialize

Methods inherited from Probe

#initialize

Methods inherited from Node

#go, #initialize, #reject

Constructor Details

This class inherits a constructor from Landline::Handlers::Handler

Instance Method Details

#process(request) ⇒ Boolean

Method callback on successful request navigation. Runs block supplied with object initialization. Request’s #splat and #param are passed to block.

Callback’s returned should be one of viable responses:

  • Response object

  • An array that matches Rack return form

  • An array that matches old (Rack 2.x) return form

  • A string (returned as HTML with code 200)

  • false (bounces the request to next handler)

Parameters:

Returns:

  • (Boolean)

    true if further navigation is possible

Raises:

  • (UncaughtThrowError)

    may raise if die() is called.



25
26
27
28
29
30
31
# File 'lib/landline/probe/http_method.rb', line 25

def process(request)
  unless request.request_method.casecmp(self.class::METHOD).zero?
    return false
  end

  super(request)
end