Method: HTTPX::Registry::ClassMethods#registry
- Defined in:
- lib/httpx/registry.rb
#registry(tag = nil) ⇒ Symbol, ...
Returns the corresponding handler (if Symbol or String, will assume it referes to an autoloaded module, and will load-and-return it).
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/httpx/registry.rb', line 58 def registry(tag = nil) @registry ||= {} return @registry if tag.nil? handler = @registry.fetch(tag) raise(Error, "#{tag} is not registered in #{self}") unless handler case handler when Symbol, String const_get(handler) else handler end end |