Class: Fluxo::Config
- Inherits:
-
Object
- Object
- Fluxo::Config
- Defined in:
- lib/fluxo/config.rb
Instance Attribute Summary collapse
-
#error_handlers ⇒ Object
readonly
Returns the value of attribute error_handlers.
-
#strict ⇒ Object
writeonly
Auto handle errors/exceptions.
-
#wrap_falsey_result ⇒ Object
When set to true, the result of a falsey operation will be wrapped in a Failure.
-
#wrap_truthy_result ⇒ Object
When set to true, the result of a truthy operation will be wrapped in a Success.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #strict? ⇒ Boolean
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
25 26 27 28 29 30 |
# File 'lib/fluxo/config.rb', line 25 def initialize @error_handlers = [] @wrap_falsey_result = false @wrap_truthy_result = false @strict = false end |
Instance Attribute Details
#error_handlers ⇒ Object (readonly)
Returns the value of attribute error_handlers.
14 15 16 |
# File 'lib/fluxo/config.rb', line 14 def error_handlers @error_handlers end |
#strict=(value) ⇒ Object (writeonly)
Auto handle errors/exceptions.
23 24 25 |
# File 'lib/fluxo/config.rb', line 23 def strict=(value) @strict = value end |
#wrap_falsey_result ⇒ Object
When set to true, the result of a falsey operation will be wrapped in a Failure.
17 18 19 |
# File 'lib/fluxo/config.rb', line 17 def wrap_falsey_result @wrap_falsey_result end |
#wrap_truthy_result ⇒ Object
When set to true, the result of a truthy operation will be wrapped in a Success.
20 21 22 |
# File 'lib/fluxo/config.rb', line 20 def wrap_truthy_result @wrap_truthy_result end |
Instance Method Details
#strict? ⇒ Boolean
32 33 34 |
# File 'lib/fluxo/config.rb', line 32 def strict? !!@strict end |