Class: Evostream::Events::OutStreamCreated
- Defined in:
- lib/evostream/event/event/events/out_stream_created.rb
Overview
Action OutStreamCreated
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(id_flux, request) ⇒ OutStreamCreated
constructor
A new instance of OutStreamCreated.
Methods inherited from Event
all_event, #class_name, descendants
Constructor Details
#initialize(id_flux, request) ⇒ OutStreamCreated
Returns a new instance of OutStreamCreated.
7 8 9 10 |
# File 'lib/evostream/event/event/events/out_stream_created.rb', line 7 def initialize(id_flux, request) super(id_flux) @request = request end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 |
# File 'lib/evostream/event/event/events/out_stream_created.rb', line 12 def execute stream_flux = what_flux.upcase.constantize model.streams.push(stream_flux.new(config_id: ex_config, flux: ex_flux)) model.save @result = { status: 201, message: 'Action successfully executed.' } end |