Class: I18nChecker::Locale::Collector::Haml

Inherits:
Object
  • Object
show all
Includes:
Collectible, FileHelper
Defined in:
lib/i18n_checker/locale/collector/haml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FileHelper

#action_view_name_of

Methods included from Collectible

#collect_all

Constructor Details

#initialize(file_caches = I18nChecker::Cache::Files.new) ⇒ Haml

Returns a new instance of Haml.



16
17
18
# File 'lib/i18n_checker/locale/collector/haml.rb', line 16

def initialize(file_caches = I18nChecker::Cache::Files.new)
  @file_caches = file_caches
end

Instance Attribute Details

#file_cachesObject (readonly)

Returns the value of attribute file_caches.



14
15
16
# File 'lib/i18n_checker/locale/collector/haml.rb', line 14

def file_caches
  @file_caches
end

Instance Method Details

#collect(template_file) ⇒ Object



20
21
22
23
24
# File 'lib/i18n_checker/locale/collector/haml.rb', line 20

def collect(template_file)
  template = read_template_file(template_file)
  parser = HamlParser::Parser.new(filename: template_file)
  I18nChecker::Locale::Texts.new(collect_locale_texts(parser.call(template)))
end