Class: Protocol::HTTP::Methods
- Inherits:
-
Object
- Object
- Protocol::HTTP::Methods
- Defined in:
- lib/protocol/http/methods.rb
Overview
All supported HTTP methods
Direct Known Subclasses
Constant Summary collapse
- GET =
'GET'- POST =
'POST'- PUT =
'PUT'- PATCH =
'PATCH'- DELETE =
'DELETE'- HEAD =
'HEAD'- OPTIONS =
'OPTIONS'- LINK =
'LINK'- UNLINK =
'UNLINK'- TRACE =
'TRACE'- CONNECT =
'CONNECT'
Class Method Summary collapse
Class Method Details
.each ⇒ Object
29 30 31 32 33 |
# File 'lib/protocol/http/methods.rb', line 29 def self.each constants.each do |name| yield name, const_get(name) end end |
.valid?(name) ⇒ Boolean
22 23 24 25 26 27 |
# File 'lib/protocol/http/methods.rb', line 22 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 |