Module: Encapsulators
- Includes:
- EasyLogging
- Defined in:
- lib/encapsulators.rb,
lib/encapsulators/helpers.rb,
lib/encapsulators/version.rb
Defined Under Namespace
Classes: Helpers
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Attribute Summary collapse
-
#exception_handling ⇒ Object
readonly
Returns the value of attribute exception_handling.
-
#lifecycle_signals ⇒ Object
readonly
Returns the value of attribute lifecycle_signals.
-
#user_interaction_before_return ⇒ Object
readonly
Returns the value of attribute user_interaction_before_return.
Class Method Summary collapse
- .exception_handling(callback:, params: nil) ⇒ Object
- .lifecycle_signals(callback:, params: nil) ⇒ Object
- .user_interaction_before_return(callback:, params: nil) ⇒ Object
Instance Attribute Details
#exception_handling ⇒ Object (readonly)
Returns the value of attribute exception_handling.
9 10 11 |
# File 'lib/encapsulators.rb', line 9 def exception_handling @exception_handling end |
#lifecycle_signals ⇒ Object (readonly)
Returns the value of attribute lifecycle_signals.
9 10 11 |
# File 'lib/encapsulators.rb', line 9 def lifecycle_signals @lifecycle_signals end |
#user_interaction_before_return ⇒ Object (readonly)
Returns the value of attribute user_interaction_before_return.
9 10 11 |
# File 'lib/encapsulators.rb', line 9 def user_interaction_before_return @user_interaction_before_return end |
Class Method Details
.exception_handling(callback:, params: nil) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/encapsulators.rb', line 11 def self.exception_handling(callback:, params: nil) begin ReflectionUtils.call(callback, params) rescue Exception => e logger.error(Helpers.ruby_style_trace(e)) end end |
.lifecycle_signals(callback:, params: nil) ⇒ Object
27 28 29 30 31 |
# File 'lib/encapsulators.rb', line 27 def self.lifecycle_signals(callback:, params: nil) logger.debug("Method '#{callback}' started") ReflectionUtils.call(callback, params) logger.debug("Method '#{callback}' finished") end |
.user_interaction_before_return(callback:, params: nil) ⇒ Object
20 21 22 23 24 |
# File 'lib/encapsulators.rb', line 20 def self.user_interaction_before_return(callback:, params: nil) ReflectionUtils.call(callback, params) logger.info('Press any key to continue') gets end |