Class: TextDetector::Detector::Regexp

Inherits:
Base
  • Object
show all
Defined in:
lib/text_detector/detector/regexp.rb

Instance Attribute Summary

Attributes inherited from Base

#dictionary

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from TextDetector::Detector::Base

Instance Method Details

#detect(text) ⇒ Object



6
7
8
9
# File 'lib/text_detector/detector/regexp.rb', line 6

def detect(text)
  detected = @re.match(text)
  detected ? detected.to_s : nil
end