Class: HtmlScssClassChecker::FileProcessor
- Inherits:
-
Object
- Object
- HtmlScssClassChecker::FileProcessor
- Defined in:
- lib/html_scss_class_checker/file_processor.rb
Instance Method Summary collapse
-
#initialize(file_path, file_type) ⇒ FileProcessor
constructor
A new instance of FileProcessor.
- #list_classes ⇒ Object
Constructor Details
#initialize(file_path, file_type) ⇒ FileProcessor
Returns a new instance of FileProcessor.
6 7 8 9 |
# File 'lib/html_scss_class_checker/file_processor.rb', line 6 def initialize(file_path, file_type) @file_path = file_path @file_type = file_type end |
Instance Method Details
#list_classes ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/html_scss_class_checker/file_processor.rb', line 11 def list_classes content = File.read(@file_path) case @file_type when 'html' ClassExtractor.extract_from_html(content) when 'scss' ClassExtractor.extract_from_scss(content) else Set.new end end |