Class: Executo::FeedbackProcessService

Inherits:
Object
  • Object
show all
Includes:
TaggedLogger
Defined in:
lib/executo/feedback_process_service.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(feedback, results) ⇒ FeedbackProcessService

Returns a new instance of FeedbackProcessService.



10
11
12
13
14
15
16
17
# File 'lib/executo/feedback_process_service.rb', line 10

def initialize(feedback, results)
  @id = feedback['id']
  @state = results['state']
  @exitstatus = results['exitstatus']
  @stdout = results['stdout'] || []
  @stderr = results['stderr'] || []
  @arguments = feedback['arguments'] || {}
end

Instance Attribute Details

#arguments=(value) ⇒ Object (writeonly)

Sets the attribute arguments

Parameters:

  • value

    the value to set the attribute arguments to.



8
9
10
# File 'lib/executo/feedback_process_service.rb', line 8

def arguments=(value)
  @arguments = value
end

#exitstatusObject (readonly)

Returns the value of attribute exitstatus.



7
8
9
# File 'lib/executo/feedback_process_service.rb', line 7

def exitstatus
  @exitstatus
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/executo/feedback_process_service.rb', line 7

def id
  @id
end

#stateObject (readonly)

Returns the value of attribute state.



7
8
9
# File 'lib/executo/feedback_process_service.rb', line 7

def state
  @state
end

#stderrObject (readonly)

Returns the value of attribute stderr.



7
8
9
# File 'lib/executo/feedback_process_service.rb', line 7

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



7
8
9
# File 'lib/executo/feedback_process_service.rb', line 7

def stdout
  @stdout
end

Class Method Details

.arguments(*names) ⇒ Object



30
31
32
33
34
# File 'lib/executo/feedback_process_service.rb', line 30

def arguments(*names)
  names.each do |name|
    define_method(name) { instance_variable_get('@arguments')[name.to_s] }
  end
end

.process_feedback(feedback, results) ⇒ Object



36
37
38
# File 'lib/executo/feedback_process_service.rb', line 36

def process_feedback(feedback, results)
  new(feedback, results).call
end

Instance Method Details

#callObject



19
20
21
22
23
# File 'lib/executo/feedback_process_service.rb', line 19

def call
  logger_add_tag(self.class.name)
  logger_add_tag(id)
  perform
end