Sha256: 039a7b83ed75f0358fd2b1e43406402adca61435e71fa320c1b9e82d9ae15079

Contents?: true

Size: 311 Bytes

Versions: 10

Compression:

Stored size: 311 Bytes

Contents

module Thredded
  class AtNotificationExtractor
    def initialize(content)
      @content = content
    end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
thredded-0.0.12 lib/thredded/at_notification_extractor.rb
thredded-0.0.10 lib/thredded/at_notification_extractor.rb
thredded-0.0.9 lib/thredded/at_notification_extractor.rb
thredded-0.0.8 lib/thredded/at_notification_extractor.rb
thredded-0.0.7 lib/thredded/at_notification_extractor.rb
thredded-0.0.6 lib/thredded/at_notification_extractor.rb
thredded-0.0.5 lib/thredded/at_notification_extractor.rb
thredded-0.0.4 lib/thredded/at_notification_extractor.rb
thredded-0.0.3 lib/thredded/at_notification_extractor.rb
thredded-0.0.1 lib/thredded/at_notification_extractor.rb