Sha256: 126109a6adba83f002b6c34b1518905838b4952f25641f9f3d4e40ed2674d457
Contents?: true
Size: 570 Bytes
Versions: 54
Compression:
Stored size: 570 Bytes
Contents
module Rack::App::SingletonMethods::Inheritance def on_inheritance(&block) @on_inheritance ||= [] @on_inheritance << block unless block.nil? @on_inheritance end protected def inherited(child) child.formats.merge!(formats) [:middlewares, :before, :after].each do |type| child.__send__(type).push(*__send__(type)) end on_inheritance.each do |block| block.call(self, child) child.on_inheritance(&block) end error.handlers.each do |ex_class, block| child.error(ex_class, &block) end end end
Version data entries
54 entries across 54 versions & 2 rubygems