Module: Dry::Rails
- Defined in:
- lib/dry/rails.rb,
lib/dry/rails/railtie.rb,
lib/dry/rails/version.rb,
lib/dry/rails/container.rb,
lib/dry/rails/auto_registrars/app.rb,
lib/dry/rails/features/safe_params.rb,
lib/dry/rails/features/controller_helpers.rb,
lib/dry/rails/features/application_contract.rb
Overview
Initializer interface
Defined Under Namespace
Modules: AutoRegistrars, Features Classes: Container, Railtie
Constant Summary collapse
- VERSION =
"0.7.0"
Class Method Summary collapse
- ._container_blocks ⇒ Object private
-
.container(&block) ⇒ self
Set container block that will be evaluated in the context of the container.
-
.create_container(options = {}) ⇒ Class
private
Create a new container class.
- .evaluate_initializer(container) ⇒ Object private
Class Method Details
._container_blocks ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
56 57 58 |
# File 'lib/dry/rails.rb', line 56 def self._container_blocks @_container_blocks ||= [] end |
.container(&block) ⇒ self
Set container block that will be evaluated in the context of the container
30 31 32 33 |
# File 'lib/dry/rails.rb', line 30 def self.container(&block) _container_blocks << block self end |
.create_container(options = {}) ⇒ Class
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create a new container class
This is used during booting and reloading
44 45 46 |
# File 'lib/dry/rails.rb', line 44 def self.create_container( = {}) Class.new(Container) { config.update() } end |
.evaluate_initializer(container) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
49 50 51 52 53 |
# File 'lib/dry/rails.rb', line 49 def self.evaluate_initializer(container) _container_blocks.each do |block| container.class_eval(&block) end end |