Class: Uses::Config
- Inherits:
-
Object
- Object
- Uses::Config
- Defined in:
- lib/uses/config.rb
Constant Summary collapse
- ON_CIRCULAR_DEPENDENCY_VALUES =
[ :ignore, :raise_error, :warn, ]
Instance Attribute Summary collapse
-
#initializers ⇒ Object
readonly
The array of custom initializers.
-
#on_circular_dependency ⇒ Object
Configure what should happen when a circular dependency is detected.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
16 17 18 |
# File 'lib/uses/config.rb', line 16 def initialize reset! end |
Instance Attribute Details
#initializers ⇒ Object (readonly)
The array of custom initializers. Generally you should use ‘Uses.initializers do |initializers|` to manipulate this
14 15 16 |
# File 'lib/uses/config.rb', line 14 def initializers @initializers end |
#on_circular_dependency ⇒ Object
Configure what should happen when a circular dependency is detected.
- :warn
-
Emit a warning, but allow it (default)
- :raise_error
-
Raise an exception, effectively making your app unusable until you resolve the circular dependencies
- :ignore
-
Emit a warning at DEBUG level, effectively allowing you to ignore these issues.
10 11 12 |
# File 'lib/uses/config.rb', line 10 def on_circular_dependency @on_circular_dependency end |
Instance Method Details
#reset! ⇒ Object
20 21 22 23 |
# File 'lib/uses/config.rb', line 20 def reset! self.on_circular_dependency = :warn @initializers = {} end |