Class: Fastererer::Analyzer
- Inherits:
-
Object
- Object
- Fastererer::Analyzer
- Defined in:
- lib/fastererer/analyzer.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
(also: #path)
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(file_path) ⇒ Analyzer
constructor
A new instance of Analyzer.
- #scan ⇒ Object
Constructor Details
#initialize(file_path) ⇒ Analyzer
Returns a new instance of Analyzer.
19 20 21 22 |
# File 'lib/fastererer/analyzer.rb', line 19 def initialize(file_path) @file_path = file_path.to_s @file_content = File.read(file_path) end |
Instance Attribute Details
#file_path ⇒ Object (readonly) Also known as: path
Returns the value of attribute file_path.
16 17 18 |
# File 'lib/fastererer/analyzer.rb', line 16 def file_path @file_path end |
Instance Method Details
#errors ⇒ Object
29 30 31 |
# File 'lib/fastererer/analyzer.rb', line 29 def errors @errors ||= Fastererer::OffenseCollector.new end |
#scan ⇒ Object
24 25 26 27 |
# File 'lib/fastererer/analyzer.rb', line 24 def scan root_node = Fastererer::Parser.parse(@file_content) root_node.accept(AnalyzerVisitor.new(errors)) end |