Class: Triangulum::Validation

Inherits:
Object
  • Object
show all
Defined in:
lib/triangulum/validation.rb

Overview

Triangulum::Validation

This class implements the validation using the typescript package

Defined Under Namespace

Classes: BunNotFound, Diagnostic, Result, TriangulumFailed

Constant Summary collapse

ENTRYPOINT =
File.expand_path('js/single-validation.js', __dir__)
BUN_EXE =
Dir.glob(File.expand_path('../../exe/*/bun', __dir__)).find do |path|
  platform = Gem::Platform.new(File.basename(File.dirname(path)))
  Gem::Platform.match_gem?(platform, Gem::Platform.local.to_s)
end
IS_RUBY_PLATFORM_GEM =
Dir.glob(File.expand_path('../../exe/*/bun', __dir__)).empty?

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flow, runtime_function_definitions, data_types) ⇒ Validation

Returns a new instance of Validation.



26
27
28
29
30
# File 'lib/triangulum/validation.rb', line 26

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.



24
25
26
# File 'lib/triangulum/validation.rb', line 24

def data_types
  @data_types
end

#flowObject (readonly)

Returns the value of attribute flow.



24
25
26
# File 'lib/triangulum/validation.rb', line 24

def flow
  @flow
end

#function_definitionsObject (readonly)

Returns the value of attribute function_definitions.



24
25
26
# File 'lib/triangulum/validation.rb', line 24

def function_definitions
  @function_definitions
end

Instance Method Details

#validateObject



32
33
34
35
36
37
38
# File 'lib/triangulum/validation.rb', line 32

def validate
  input = serialize_input

  output = run_ts_triangulum(input)

  parse_output(output)
end