Class: RobotLab::CompactionHookContext
- Inherits:
-
HookContext
- Object
- HookContext
- RobotLab::CompactionHookContext
- Defined in:
- lib/robot_lab/hook_context.rb
Instance Attribute Summary collapse
-
#compacted_messages ⇒ Object
Returns the value of attribute compacted_messages.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#error ⇒ Object
Returns the value of attribute error.
-
#messages_before ⇒ Object
readonly
Returns the value of attribute messages_before.
-
#robot ⇒ Object
readonly
Returns the value of attribute robot.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Attributes inherited from HookContext
Instance Method Summary collapse
-
#handled? ⇒ Boolean
True once an on_compaction handler has supplied a replacement message set.
-
#initialize(robot:, messages_before:, config:, strategy:) ⇒ CompactionHookContext
constructor
A new instance of CompactionHookContext.
Methods inherited from HookContext
#ext, #local, #to_h, #with_namespace
Constructor Details
#initialize(robot:, messages_before:, config:, strategy:) ⇒ CompactionHookContext
Returns a new instance of CompactionHookContext.
137 138 139 140 141 142 143 144 |
# File 'lib/robot_lab/hook_context.rb', line 137 def initialize(robot:, messages_before:, config:, strategy:, **) super(event: :compaction, **) @robot = robot @messages_before = .freeze @config = config @strategy = strategy @compacted_messages = nil end |
Instance Attribute Details
#compacted_messages ⇒ Object
Returns the value of attribute compacted_messages.
135 136 137 |
# File 'lib/robot_lab/hook_context.rb', line 135 def @compacted_messages end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
134 135 136 |
# File 'lib/robot_lab/hook_context.rb', line 134 def config @config end |
#error ⇒ Object
Returns the value of attribute error.
135 136 137 |
# File 'lib/robot_lab/hook_context.rb', line 135 def error @error end |
#messages_before ⇒ Object (readonly)
Returns the value of attribute messages_before.
134 135 136 |
# File 'lib/robot_lab/hook_context.rb', line 134 def @messages_before end |
#robot ⇒ Object (readonly)
Returns the value of attribute robot.
134 135 136 |
# File 'lib/robot_lab/hook_context.rb', line 134 def robot @robot end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
134 135 136 |
# File 'lib/robot_lab/hook_context.rb', line 134 def strategy @strategy end |
Instance Method Details
#handled? ⇒ Boolean
True once an on_compaction handler has supplied a replacement message set.
147 148 149 |
# File 'lib/robot_lab/hook_context.rb', line 147 def handled? !@compacted_messages.nil? end |