Class: Translatomatic::Extractor::Base
- Inherits:
-
Object
- Object
- Translatomatic::Extractor::Base
- Defined in:
- lib/translatomatic/extractor/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(path) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(path) ⇒ Base
4 5 6 7 |
# File 'lib/translatomatic/extractor/base.rb', line 4 def initialize(path) @path = path.kind_of?(Pathname) ? path : Pathname.new(path) @contents = @path.read end |
Instance Method Details
#extract ⇒ Object
9 10 11 |
# File 'lib/translatomatic/extractor/base.rb', line 9 def extract @contents.scan(/\"(.*?[^\\])"|'(.*?[^\\])'/).flatten.compact end |