Module: Sinatra::Contrib::Loader
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Extended In:
| |
Defined in: | sinatra-contrib/lib/sinatra/contrib/setup.rb |
Instance Method Summary
Instance Method Details
#autoload(name, path, method = nil)
[ GitHub ]# File 'sinatra-contrib/lib/sinatra/contrib/setup.rb', line 21
def autoload(name, path, method = nil) extensions[method] << name if method Sinatra.autoload(name, path) end
#extensions
[ GitHub ]# File 'sinatra-contrib/lib/sinatra/contrib/setup.rb', line 9
def extensions @extensions ||= { helpers: [], register: [] } end
#helpers(name, path)
[ GitHub ]#register(name, path)
[ GitHub ]#registered(base)
[ GitHub ]# File 'sinatra-contrib/lib/sinatra/contrib/setup.rb', line 26
def registered(base) @extensions.each do |method, list| list = list.map { |name| Sinatra.const_get name } base.send(method, *list) unless base == ::Sinatra::Application end end