Class: Haml::I18n::Extractor::TextFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/haml-i18n-extractor/extraction/text_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(orig_line, line_metadata) ⇒ TextFinder

Returns a new instance of TextFinder.



8
9
10
11
# File 'lib/haml-i18n-extractor/extraction/text_finder.rb', line 8

def initialize(orig_line,)
  @orig_line = orig_line
  @metadata = 
end

Instance Method Details

#process_by_regexObject

returns [ line_type, text_found ]



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/haml-i18n-extractor/extraction/text_finder.rb', line 14

def process_by_regex
  if Haml::I18n::Extractor.debug?
    binding.pry
    puts '!!!'
    puts @metadata && @metadata[:type]
    puts @orig_line
  end
  # if any of the handler methods return nil the extractor just outputs orig_line and keeps on going.
  # if there's an empty string that should do the trick to ( ExceptionFinder can return no match that way )
  @metadata && send("#{@metadata[:type]}", @metadata)
end