Class: Henry::Execution

Inherits:
Object
  • Object
show all
Defined in:
lib/henry/execution.rb

Overview

Henry Execution

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backtraceObject

Accessors for task_name, code, message, output and backtrace.



7
8
9
# File 'lib/henry/execution.rb', line 7

def backtrace
  @backtrace
end

#codeObject

Accessors for task_name, code, message, output and backtrace.



7
8
9
# File 'lib/henry/execution.rb', line 7

def code
  @code
end

#descriptionObject

Accessors for task_name, code, message, output and backtrace.



7
8
9
# File 'lib/henry/execution.rb', line 7

def description
  @description
end

#logObject

Accessors for task_name, code, message, output and backtrace.



7
8
9
# File 'lib/henry/execution.rb', line 7

def log
  @log
end

#messageObject

Accessors for task_name, code, message, output and backtrace.



7
8
9
# File 'lib/henry/execution.rb', line 7

def message
  @message
end

#outputObject

Accessors for task_name, code, message, output and backtrace.



7
8
9
# File 'lib/henry/execution.rb', line 7

def output
  @output
end

#paramsObject

Accessors for task_name, code, message, output and backtrace.



7
8
9
# File 'lib/henry/execution.rb', line 7

def params
  @params
end

#task_nameObject

Accessors for task_name, code, message, output and backtrace.



7
8
9
# File 'lib/henry/execution.rb', line 7

def task_name
  @task_name
end

Instance Method Details

#reportHash

Returns the json ready hash report of the Task Execution

Returns:

  • (Hash)


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/henry/execution.rb', line 12

def report
  {
    name: self.task_name,
    code: self.code,
    message: self.message,
    description: self.description,
    returnedData: map.merge({
      output: self.output,
      backtrace: self.backtrace
    }),
    log: self.log,
    worker: `hostname`.strip,
    parameters: self.params||{}
  }
end

#set(key, value) ⇒ Object

Sets the given value under the map key.

Parameters:

  • key (Symbol, String)

    map key to store the given value.

  • value (String, Integer)

    the value to be stored.



32
33
34
# File 'lib/henry/execution.rb', line 32

def set(key,value)
  self.map[key.to_sym] = value
end