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.
17 18 19 20 |
# File 'lib/fastererer/analyzer.rb', line 17 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.
14 15 16 |
# File 'lib/fastererer/analyzer.rb', line 14 def file_path @file_path end |
Instance Method Details
#errors ⇒ Object
27 28 29 |
# File 'lib/fastererer/analyzer.rb', line 27 def errors @errors ||= Fastererer::OffenseCollector.new end |
#scan ⇒ Object
22 23 24 25 |
# File 'lib/fastererer/analyzer.rb', line 22 def scan sexp_tree = Fastererer::Parser.parse(@file_content) traverse_sexp_tree(sexp_tree) end |