Class: Dry::Web::Roda::Application

Inherits:
Roda
  • Object
show all
Extended by:
Configurable
Defined in:
lib/dry/web/roda/application.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.[](name) ⇒ Object



26
27
28
# File 'lib/dry/web/roda/application.rb', line 26

def self.[](name)
  container[name]
end

.configure(&block) ⇒ Object



16
17
18
19
20
# File 'lib/dry/web/roda/application.rb', line 16

def self.configure(&block)
  super.tap do
    use(container[:rack_monitor]) if container.config.listeners
  end
end

.load_routes!Object



30
31
32
# File 'lib/dry/web/roda/application.rb', line 30

def self.load_routes!
  Dir[root.join("#{config.routes}/**/*.rb")].each { |f| require f }
end

.resolve(name) ⇒ Object



22
23
24
# File 'lib/dry/web/roda/application.rb', line 22

def self.resolve(name)
  container[name]
end

.rootObject



34
35
36
# File 'lib/dry/web/roda/application.rb', line 34

def self.root
  container.config.root
end

Instance Method Details

#notificationsObject



38
39
40
# File 'lib/dry/web/roda/application.rb', line 38

def notifications
  self.class[:notifications]
end