Sha256: 4ad9e47efcfbe83aca841d51fb74c36e332575a4f5d985843ac65d2d10de71dd

Contents?: true

Size: 337 Bytes

Versions: 5

Compression:

Stored size: 337 Bytes

Contents

# frozen_string_literal: true
module Thredded
  class AtNotificationExtractor
    def initialize(content)
      @content = content
    end

    def run
      scanned_names = @content.scan(/@([\w]+)(\W)?/)
      scanned_names += @content.scan(/@"([\w\ ]+)"(\W)?/)
      scanned_names
        .map(&:first)
        .uniq
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
thredded-0.5.0 app/commands/thredded/at_notification_extractor.rb
thredded-0.4.0 app/commands/thredded/at_notification_extractor.rb
thredded-0.3.2 app/commands/thredded/at_notification_extractor.rb
thredded-0.3.1 app/commands/thredded/at_notification_extractor.rb
thredded-0.3.0 app/commands/thredded/at_notification_extractor.rb