Class: Protocol::HTTP::Methods

Inherits:
Object
  • Object
show all
Defined in:
lib/protocol/http/methods.rb

Overview

All supported HTTP methods

Direct Known Subclasses

Middleware

Constant Summary collapse

GET =
'GET'
POST =
'POST'
PUT =
'PUT'
PATCH =
'PATCH'
DELETE =
'DELETE'
HEAD =
'HEAD'
OPTIONS =
'OPTIONS'
'LINK'
'UNLINK'
TRACE =
'TRACE'
CONNECT =
'CONNECT'

Class Method Summary collapse

Class Method Details

.eachObject



46
47
48
49
50
# File 'lib/protocol/http/methods.rb', line 46

def self.each
	constants.each do |name|
		yield name, const_get(name)
	end
end

.valid?(name) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
42
43
44
# File 'lib/protocol/http/methods.rb', line 39

def self.valid?(name)
	const_defined?(name)
rescue NameError
	# Ruby will raise an exception if the name is not valid for a constant.
	return false
end