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
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
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 |