registry: passing along registers to subclasses

This commit is contained in:
HoneyryderChuck 2017-12-20 18:56:29 +02:00
parent 6d7c3d73b6
commit f375a9bbb9

View File

@ -46,6 +46,11 @@ module HTTPX
# Class Methods
module ClassMethods
def inherited(klass)
super
klass.instance_variable_set(:@registry, @registry.dup)
end
# @param [Object] tag the handler identifier in the registry
# @return [Symbol, String, Object] the corresponding handler (if Symbol or String,
# will assume it referes to an autoloaded module, and will load-and-return it).