Class: I18nChecker::Locale::Collector::Haml
- Inherits:
-
Object
- Object
- I18nChecker::Locale::Collector::Haml
- Includes:
- Collectible, FileHelper
- Defined in:
- lib/i18n_checker/locale/collector/haml.rb
Instance Attribute Summary collapse
-
#file_caches ⇒ Object
readonly
Returns the value of attribute file_caches.
Instance Method Summary collapse
- #collect(template_file) ⇒ Object
-
#initialize(file_caches = I18nChecker::Cache::Files.new) ⇒ Haml
constructor
A new instance of Haml.
Methods included from FileHelper
Methods included from Collectible
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_caches ⇒ Object (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 |