Class: RuntimeFactory

Inherits:
AbstractRuntimeFactory show all
Defined in:
lib/javonet-ruby-sdk/sdk/runtime_factory.rb

Overview

The RuntimeFactory class implements the AbstractRuntimeFactory interface and provides methods for creating runtime contexts. Each method corresponds to a specific runtime (CLR, JVM, .NET Core, Perl, Ruby, Node.js, Python) and returns a RuntimeContext instance for that runtime. # @see Refer to this article on Javonet Guides

Instance Method Summary collapse

Constructor Details

#initialize(connection_type, tcp_connection_data) ⇒ RuntimeFactory

Returns a new instance of RuntimeFactory.



11
12
13
14
# File 'lib/javonet-ruby-sdk/sdk/runtime_factory.rb', line 11

def initialize(connection_type, tcp_connection_data)
  @connection_type = connection_type
  @tcp_connection_data = tcp_connection_data
end

Instance Method Details

#clrRuntimeContext

Creates a RuntimeContext instance to interact with CLR runtime.

Returns:

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/runtime-context article on Javonet Guides}


19
20
21
# File 'lib/javonet-ruby-sdk/sdk/runtime_factory.rb', line 19

def clr
  RuntimeContext.get_instance(RuntimeName::CLR, @connection_type, @tcp_connection_data)
end

#jvmRuntimeContext

Creates a RuntimeContext instance to interact with JVM runtime.

Returns:

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/runtime-context article on Javonet Guides}


26
27
28
# File 'lib/javonet-ruby-sdk/sdk/runtime_factory.rb', line 26

def jvm
  RuntimeContext.get_instance(RuntimeName::JVM, @connection_type, @tcp_connection_data)
end

#netcoreRuntimeContext

Creates a RuntimeContext instance to interact with .NET runtime.

Returns:

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/runtime-context article on Javonet Guides}


33
34
35
# File 'lib/javonet-ruby-sdk/sdk/runtime_factory.rb', line 33

def netcore
  RuntimeContext.get_instance(RuntimeName::NETCORE, @connection_type, @tcp_connection_data)
end

#nodejsRuntimeContext

Creates a RuntimeContext instance to interact with Node.js runtime.

Returns:

  • (RuntimeContext)

    a RuntimeContext instance for the Node.js runtime

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/runtime-context article on Javonet Guides}


54
55
56
# File 'lib/javonet-ruby-sdk/sdk/runtime_factory.rb', line 54

def nodejs
  RuntimeContext.get_instance(RuntimeName::NODEJS, @connection_type, @tcp_connection_data)
end

#perlRuntimeContext

Creates a RuntimeContext instance to interact with Perl runtime.

Returns:

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/runtime-context article on Javonet Guides}


40
41
42
# File 'lib/javonet-ruby-sdk/sdk/runtime_factory.rb', line 40

def perl
  RuntimeContext.get_instance(RuntimeName::PERL, @connection_type, @tcp_connection_data)
end

#pythonRuntimeContext

Creates a RuntimeContext instance to interact with Python runtime.

Returns:

  • (RuntimeContext)

    a RuntimeContext instance for the Python runtime

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/runtime-context article on Javonet Guides}


61
62
63
# File 'lib/javonet-ruby-sdk/sdk/runtime_factory.rb', line 61

def python
  RuntimeContext.get_instance(RuntimeName::PYTHON, @connection_type, @tcp_connection_data)
end

#rubyRuntimeContext

Creates a RuntimeContext instance to interact with Ruby runtime.

Returns:

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/runtime-context article on Javonet Guides}


47
48
49
# File 'lib/javonet-ruby-sdk/sdk/runtime_factory.rb', line 47

def ruby
  RuntimeContext.get_instance(RuntimeName::RUBY, @connection_type, @tcp_connection_data)
end