Class: Triangulum::FlowSchemaExtraction

Inherits:
Object
  • Object
show all
Includes:
Executor
Defined in:
lib/triangulum/flow_schema_extraction.rb

Overview

Triangulum::FlowSchemaExtraction

This class implements the extraction of flow schemas using the typescript package

Defined Under Namespace

Classes: Result, SchematizedObject

Constant Summary collapse

ENTRYPOINT =
File.expand_path('js/flow-schema-extraction.js', __dir__)

Constants included from Executor

Executor::BUN_EXE, Executor::IS_RUBY_PLATFORM_GEM

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Executor

#bun, #run_ts_triangulum

Constructor Details

#initialize(flow, runtime_function_definitions, data_types) ⇒ FlowSchemaExtraction

Returns a new instance of FlowSchemaExtraction.



16
17
18
19
20
# File 'lib/triangulum/flow_schema_extraction.rb', line 16

def initialize(flow, runtime_function_definitions, data_types)
  @flow = flow
  @function_definitions = runtime_function_definitions
  @data_types = data_types
end

Instance Attribute Details

#data_typesObject (readonly)

Returns the value of attribute data_types.



14
15
16
# File 'lib/triangulum/flow_schema_extraction.rb', line 14

def data_types
  @data_types
end

#flowObject (readonly)

Returns the value of attribute flow.



14
15
16
# File 'lib/triangulum/flow_schema_extraction.rb', line 14

def flow
  @flow
end

#function_definitionsObject (readonly)

Returns the value of attribute function_definitions.



14
15
16
# File 'lib/triangulum/flow_schema_extraction.rb', line 14

def function_definitions
  @function_definitions
end

Instance Method Details

#extractObject



22
23
24
25
26
27
28
# File 'lib/triangulum/flow_schema_extraction.rb', line 22

def extract
  input = serialize_input

  output = run_ts_triangulum(ENTRYPOINT, input)

  parse_output(output)
end