Class: Mutant::Parser Private
- Inherits:
-
Object
- Object
- Mutant::Parser
- Includes:
- Unparser::Adamantium
- Defined in:
- lib/mutant/parser.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
An AST Parser
Instance Method Summary collapse
-
#call(path) ⇒ AST::Node
private
Parse path into AST.
-
#initialize ⇒ undefined
constructor
private
Initialize object.
Constructor Details
#initialize ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize object
11 12 13 |
# File 'lib/mutant/parser.rb', line 11 def initialize @cache = {} end |
Instance Method Details
#call(path) ⇒ AST::Node
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parse path into AST
20 21 22 |
# File 'lib/mutant/parser.rb', line 20 def call(path) @cache[path.] ||= parse(path.read) end |