Class: Core::Pipeline::Compiler

Inherits:
Object
  • Object
show all
Defined in:
lib/core/pipeline/compiler.rb

Overview

public

Compiles a pipeline into evalable code.

Class Method Summary collapse

Class Method Details

.compile(callable, object) ⇒ Object

public

Compiles a callable pipeline in context of an object.



14
15
16
17
18
19
20
21
22
# File 'lib/core/pipeline/compiler.rb', line 14

def compile(callable, object)
  <<~CODE
    def call(object, ...)
    #{compile_call(callable, object)}
    rescue Core::Pipeline::Signals::Halted => error
      error.value
    end
  CODE
end