Module: Roy::Halt

Defined in:
lib/roy/halt.rb

Overview

This module add a halt method to the application context that allows you to break during a handler and immediately return a status code and a body.

Included by default.

Examples:

A Not Found application


class NotFoundApp
  include Roy

  def get(_)
    halt 404
  end
end

Test


Defined Under Namespace

Modules: InstanceMethods

Class Method Summary (collapse)

Class Method Details

+ (Object) setup(roy)



24
25
26
# File 'lib/roy/halt.rb', line 24

def self.setup(roy)
  roy.send(:extend, InstanceMethods)
end