Module: Diana::Config
- Included in:
- Diana
- Defined in:
- lib/diana/config.rb
Overview
Defines Diana module configuration methods
Instance Method Summary collapse
-
#methods_visibility ⇒ Symbol
private
Returns the current visibility of dependency methods.
-
#methods_visibility=(visibility) ⇒ Symbol
Sets the visibility of dependency methods.
-
#resolve(value) ⇒ Object
private
Resolves a given value using the current resolver.
-
#resolver ⇒ #call
private
Returns the current resolver.
-
#resolver=(new_resolver) ⇒ #call
Sets a new resolver.
Instance Method Details
#methods_visibility ⇒ Symbol
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.
Returns the current visibility of dependency methods.
55 56 57 |
# File 'lib/diana/config.rb', line 55 def methods_visibility @methods_visibility || DEFAULT_METHODS_VISIBILITY end |
#methods_visibility=(visibility) ⇒ Symbol
Sets the visibility of dependency methods.
68 69 70 71 72 73 74 |
# File 'lib/diana/config.rb', line 68 def methods_visibility=(visibility) if (visibility != :private) && (visibility != :public) && (visibility != :protected) raise ArgumentError, "methods_visibility value must be :private, :public, or :protected" end @methods_visibility = visibility end |
#resolve(value) ⇒ 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.
Resolves a given value using the current resolver.
47 48 49 |
# File 'lib/diana/config.rb', line 47 def resolve(value) resolver.call(value) end |
#resolver ⇒ #call
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.
Returns the current resolver.
21 22 23 |
# File 'lib/diana/config.rb', line 21 def resolver @resolver || DEFAULT_RESOLVER end |
#resolver=(new_resolver) ⇒ #call
Sets a new resolver.
38 39 40 |
# File 'lib/diana/config.rb', line 38 def resolver=(new_resolver) @resolver = new_resolver end |