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

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

Instance Method Summary collapse

Methods included from Helpers::StringHelpers

#could_match_script?, #html_comment?, #link_to?

Constructor Details

#initialize(orig_line, line_metadata) ⇒ TextFinder

if any of the private 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 )



12
13
14
15
# File 'lib/haml-i18n-extractor/extraction/text_finder.rb', line 12

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

Instance Method Details

#process_by_regexObject



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

def process_by_regex
  # [ line_type, text_found ]
  if Haml::I18n::Extractor.debug?
    puts @metadata && @metadata[:type]
    puts @metadata.inspect
    puts @orig_line
  end
  @metadata && send("#{@metadata[:type]}", @metadata)
end