Sha256: c98d85703ed5ab133a9fbf2efb0e9f337a3bbb0f4709aa8df94882c4bdd91b09

Contents?: true

Size: 492 Bytes

Versions: 4

Compression:

Stored size: 492 Bytes

Contents

# encoding: UTF-8

module Mojito::Rendering
	
	module StatusCodes
		
		def ok!
			response.status = 200
			halt!
		end
		
		def not_found!
			response.status = 404
			halt!
		end
		
		def internal_server_error!
			response.status = 500
			halt!
		end
		
		def unavailable!
			response.status = 503
			halt!
		end
		
		def redirect(target, status = 302)
			response.redirect(target, status)
		end
		
		def redirect!(target, status = 302)
			redirect target, status
			halt!
		end
		
	end
	
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mojito-0.2.4 lib/mojito/rendering/status_codes.rb
mojito-0.2.3 lib/mojito/rendering/status_codes.rb
mojito-0.1.1 lib/mojito/rendering/status_codes.rb
mojito-0.1.0 lib/mojito/rendering/status_codes.rb