Class: GenerateBuffer

Inherits:
Parser::AST::Processor
  • Object
show all
Includes:
Callable, RuboCop::AST::Traversal
Defined in:
app/services/generate_buffer.rb

Defined Under Namespace

Classes: FindMethod, InitializeModuleClass, Replace, Url

Constant Summary collapse

DEFAULT_BUFFER =
<<~NODE
  module Fresco
    class Dev
    end
  end
NODE

Instance Method Summary collapse

Methods included from Callable

#initialize

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/services/generate_buffer.rb', line 14

def call
  @code = DEFAULT_BUFFER
  @buffer = RuboCop::ProcessedSource.new(@code, 2.7)

  fields.each do |field|
    @buffer = "#{self.class}::#{field.classify}"
                .constantize
                .call(buffer: @buffer, params: params)
  end

  @buffer
end