# class WebConsole::Testing::ERBPrecompiler

This class is to pre-compile 'templates/*.erb'.

### Public Class Methods

new(path) click to toggle source

    # File lib/web_console/testing/erb_precompiler.rb, line 8
    def initialize(path)
      @erb  = ERB.new(File.read(path))
      @view = FakeMiddleware.new(
        view_path: Helper.gem_root.join('lib/web_console/templates'),
      ).view
    end

### Public Instance Methods

build() click to toggle source

    # File lib/web_console/testing/erb_precompiler.rb, line 15
    def build
      @erb.result(binding)
    end

method_missing(name, *args, &block) click to toggle source
Calls superclass method

    # File lib/web_console/testing/erb_precompiler.rb, line 19
    def method_missing(name, *args, &block)
      return super unless @view.respond_to?(name)
      @view.send(name, *args, &block)
    end