Class: Evostream::Events::OutStreamCreated

Inherits:
Event
  • Object
show all
Defined in:
lib/evostream/event/event/events/out_stream_created.rb

Overview

Action OutStreamCreated

Instance Method Summary collapse

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

#executeObject



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