Class: SimpleFlow::MiddleWare::Logging
- Inherits:
-
Object
- Object
- SimpleFlow::MiddleWare::Logging
- Defined in:
- lib/simple_flow/middleware.rb
Instance Method Summary collapse
- #call(result) ⇒ Object
-
#initialize(callable, logger = nil) ⇒ Logging
constructor
A new instance of Logging.
Constructor Details
#initialize(callable, logger = nil) ⇒ Logging
Returns a new instance of Logging.
4 5 6 |
# File 'lib/simple_flow/middleware.rb', line 4 def initialize(callable, logger = nil) @callable, @logger = callable, logger end |
Instance Method Details
#call(result) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/simple_flow/middleware.rb', line 8 def call(result) logger.info("Before call") result = @callable.call(result) logger.info("After call") result end |