Class: Markbridge::Processors::DiscourseMarkdown::Detectors::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/markbridge/processors/discourse_markdown/detectors/base.rb

Overview

This class is abstract.

Subclass and implement #detect

Base class for construct detectors. Subclasses implement detection logic for specific constructs (mentions, polls, events, uploads).

Direct Known Subclasses

Event, Mention, Poll, Upload

Instance Method Summary collapse

Instance Method Details

#detect(input, pos) ⇒ Match?

Attempt to detect a construct at the given position.

Parameters:

  • input (String)

    the full input string

  • pos (Integer)

    current position to check

Returns:

  • (Match, nil)

    match result or nil if no match

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/markbridge/processors/discourse_markdown/detectors/base.rb', line 24

def detect(input, pos)
  raise NotImplementedError, "#{self.class} must implement #detect"
end