Class: RailsPipeline::SubscriberHandler::BaseHandler
- Inherits:
-
Object
- Object
- RailsPipeline::SubscriberHandler::BaseHandler
- Defined in:
- lib/rails-pipeline/handlers/base_handler.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#envelope ⇒ Object
readonly
Returns the value of attribute envelope.
-
#event_type ⇒ Object
readonly
Returns the value of attribute event_type.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#target_class ⇒ Object
readonly
Returns the value of attribute target_class.
Instance Method Summary collapse
-
#initialize(payload, target_class: nil, envelope: nil, event_type: nil) ⇒ BaseHandler
constructor
A new instance of BaseHandler.
Constructor Details
#initialize(payload, target_class: nil, envelope: nil, event_type: nil) ⇒ BaseHandler
Returns a new instance of BaseHandler.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/rails-pipeline/handlers/base_handler.rb', line 6 def initialize(payload, target_class: nil, envelope: nil, event_type: nil) @payload = payload @target_class = target_class @envelope = envelope if envelope @event_type = envelope.event_type else @event_type = event_type end end |
Instance Attribute Details
#envelope ⇒ Object (readonly)
Returns the value of attribute envelope.
4 5 6 |
# File 'lib/rails-pipeline/handlers/base_handler.rb', line 4 def envelope @envelope end |
#event_type ⇒ Object (readonly)
Returns the value of attribute event_type.
4 5 6 |
# File 'lib/rails-pipeline/handlers/base_handler.rb', line 4 def event_type @event_type end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
4 5 6 |
# File 'lib/rails-pipeline/handlers/base_handler.rb', line 4 def payload @payload end |
#target_class ⇒ Object (readonly)
Returns the value of attribute target_class.
4 5 6 |
# File 'lib/rails-pipeline/handlers/base_handler.rb', line 4 def target_class @target_class end |