Class: Aidp::Watch::BaseProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/aidp/watch/base_processor.rb

Overview

Base class for Watch Mode processors

Direct Known Subclasses

RebaseProcessor

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository_client:, state_store: nil, label_config: {}, verbose: false) ⇒ BaseProcessor

Returns a new instance of BaseProcessor.



7
8
9
10
11
12
13
14
15
16
# File 'lib/aidp/watch/base_processor.rb', line 7

def initialize(repository_client:, state_store: nil, label_config: {}, verbose: false)
  @repository_client = repository_client
  @state_store = state_store
  @verbose = verbose

  # Only use string or symbol access for label_config
  @rebase_label = label_config[:rebase_trigger] ||
    label_config["rebase_trigger"] ||
    "aidp-rebase"
end

Instance Attribute Details

#rebase_labelObject (readonly)

Returns the value of attribute rebase_label.



32
33
34
# File 'lib/aidp/watch/base_processor.rb', line 32

def rebase_label
  @rebase_label
end

Instance Method Details

#can_process?(work_item) ⇒ Boolean

Checks if this processor can handle the current work item

Parameters:

  • work_item (WorkItem)

    The work item to check

Returns:

  • (Boolean)

    Whether the work item can be processed

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/aidp/watch/base_processor.rb', line 21

def can_process?(work_item)
  raise NotImplementedError, "Subclasses must implement can_process?"
end

#process(work_item) ⇒ Boolean

Process the work item

Parameters:

  • work_item (WorkItem)

    The work item to process

Returns:

  • (Boolean)

    Whether the work item was processed successfully

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/aidp/watch/base_processor.rb', line 28

def process(work_item)
  raise NotImplementedError, "Subclasses must implement process"
end