Module: Service::Initializer
- Included in:
- Service
- Defined in:
- app/concerns/service.rb
Overview
Prepended before ActiveModel so logger can be extracted from attrs
before they are handed to ActiveModel::Attributes#initialize.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ void
Initializes the service, extracting a custom logger from attrs.
Instance Method Details
#initialize(attrs = {}) ⇒ void
Initializes the service, extracting a custom logger from attrs.
20 21 22 23 24 |
# File 'app/concerns/service.rb', line 20 def initialize(attrs = {}) attrs = attrs.is_a?(Hash) ? attrs.dup : {} @logger = attrs.delete(:logger) || attrs.delete('logger') super end |