Module: Sinatra::Contrib::Loader
- Included in:
- Sinatra::Contrib, Common, Custom
- Defined in:
- lib/sinatra/contrib/setup.rb
Instance Method Summary collapse
- #autoload(name, path, method = nil) ⇒ Object
- #extensions ⇒ Object
- #helpers(name, path) ⇒ Object
- #register(name, path) ⇒ Object
- #registered(base) ⇒ Object
Instance Method Details
#autoload(name, path, method = nil) ⇒ Object
21 22 23 24 |
# File 'lib/sinatra/contrib/setup.rb', line 21 def autoload(name, path, method = nil) extensions[method] << name if method Sinatra.autoload(name, path) end |
#extensions ⇒ Object
9 10 11 |
# File 'lib/sinatra/contrib/setup.rb', line 9 def extensions @extensions ||= { helpers: [], register: [] } end |
#helpers(name, path) ⇒ Object
17 18 19 |
# File 'lib/sinatra/contrib/setup.rb', line 17 def helpers(name, path) autoload name, path, :helpers end |
#register(name, path) ⇒ Object
13 14 15 |
# File 'lib/sinatra/contrib/setup.rb', line 13 def register(name, path) autoload name, path, :register end |