Sha256: e78fbcb80af1419751487643a0302940a67b127863aa791d91e1020fb296b53e

Contents?: true

Size: 453 Bytes

Versions: 2

Compression:

Stored size: 453 Bytes

Contents

# encoding: UTF-8

class ::Rack::Request
	
	def captures
		@env['mojito/captures'] ||= []
	end
	
	def locals
		@env['mojito/locals'] ||= Mash.new
	end
	
	def script_name
		@env['SCRIPT_NAME']
	end
	
	def path_info
		@env['PATH_INFO']
	end
	
	get_method = instance_method(:GET)
	define_method :GET do
		get_method.bind(self).call.to_mash
	end
	
	post_method = instance_method(:POST)
	define_method :POST do
		post_method.bind(self).call.to_mash
	end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mojito-0.1.1 lib/mojito/request_extensions.rb
mojito-0.1.0 lib/mojito/request_extensions.rb