Class: RobotLab::TaskHookContext

Inherits:
HookContext show all
Defined in:
lib/robot_lab/hook_context.rb

Instance Attribute Summary collapse

Attributes inherited from HookContext

#event, #metadata

Instance Method Summary collapse

Methods inherited from HookContext

#ext, #local, #to_h, #with_namespace

Constructor Details

#initialize(task:, network: nil, robot: nil, memory: nil, config: nil, result: nil, error: nil) ⇒ TaskHookContext

Returns a new instance of TaskHookContext.



107
108
109
110
111
112
113
114
115
116
117
# File 'lib/robot_lab/hook_context.rb', line 107

def initialize(task:, network: nil, robot: nil, memory: nil, config: nil, result: nil, error: nil, **)
  super(event: :task, **)
  @network = network
  @task = task
  @task_name = task.name
  @robot = robot || task.robot
  @memory = memory
  @config = config
  @result = result
  @error = error
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



104
105
106
# File 'lib/robot_lab/hook_context.rb', line 104

def config
  @config
end

#errorObject

Returns the value of attribute error.



105
106
107
# File 'lib/robot_lab/hook_context.rb', line 105

def error
  @error
end

#memoryObject (readonly)

Returns the value of attribute memory.



104
105
106
# File 'lib/robot_lab/hook_context.rb', line 104

def memory
  @memory
end

#networkObject (readonly)

Returns the value of attribute network.



104
105
106
# File 'lib/robot_lab/hook_context.rb', line 104

def network
  @network
end

#resultObject

Returns the value of attribute result.



105
106
107
# File 'lib/robot_lab/hook_context.rb', line 105

def result
  @result
end

#robotObject (readonly)

Returns the value of attribute robot.



104
105
106
# File 'lib/robot_lab/hook_context.rb', line 104

def robot
  @robot
end

#taskObject (readonly)

Returns the value of attribute task.



104
105
106
# File 'lib/robot_lab/hook_context.rb', line 104

def task
  @task
end

#task_nameObject (readonly)

Returns the value of attribute task_name.



104
105
106
# File 'lib/robot_lab/hook_context.rb', line 104

def task_name
  @task_name
end