Class: SorbetErb::CodeExtractor
- Inherits:
-
Object
- Object
- SorbetErb::CodeExtractor
- Defined in:
- lib/sorbet_erb/code_extractor.rb
Instance Method Summary collapse
- #extract(input) ⇒ Object
-
#initialize ⇒ CodeExtractor
constructor
A new instance of CodeExtractor.
Constructor Details
#initialize ⇒ CodeExtractor
Returns a new instance of CodeExtractor.
8 |
# File 'lib/sorbet_erb/code_extractor.rb', line 8 def initialize; end |
Instance Method Details
#extract(input) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/sorbet_erb/code_extractor.rb', line 10 def extract(input) buffer = Parser::Source::Buffer.new('(buffer)') buffer.source = input parser = BetterHtml::Parser.new(buffer) p = CodeProcessor.new p.process(parser.ast) [p.output, p.locals, p.locals_sig] end |