Class: RobotLab::LearnHookContext

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(robot:, text:, learnings_before:) ⇒ LearnHookContext

Returns a new instance of LearnHookContext.



124
125
126
127
128
129
130
# File 'lib/robot_lab/hook_context.rb', line 124

def initialize(robot:, text:, learnings_before:, **)
  super(event: :learn, **)
  @robot            = robot
  @text             = text
  @learnings_before = learnings_before.freeze
  @stored           = false
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



122
123
124
# File 'lib/robot_lab/hook_context.rb', line 122

def error
  @error
end

#learnings_beforeObject (readonly)

Returns the value of attribute learnings_before.



121
122
123
# File 'lib/robot_lab/hook_context.rb', line 121

def learnings_before
  @learnings_before
end

#robotObject (readonly)

Returns the value of attribute robot.



121
122
123
# File 'lib/robot_lab/hook_context.rb', line 121

def robot
  @robot
end

#storedObject

Returns the value of attribute stored.



122
123
124
# File 'lib/robot_lab/hook_context.rb', line 122

def stored
  @stored
end

#textObject (readonly)

Returns the value of attribute text.



121
122
123
# File 'lib/robot_lab/hook_context.rb', line 121

def text
  @text
end