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, 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, connection_data)
  @connection_type = connection_type
  @connection_data = 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(RuntimeNameJavonet::CLR, @connection_type, @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(RuntimeNameJavonet::JVM, @connection_type, @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(RuntimeNameJavonet::NETCORE, @connection_type, @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(RuntimeNameJavonet::NODEJS, @connection_type, @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(RuntimeNameJavonet::PERL, @connection_type, @connection_data)
end

#phpRuntimeContext

Creates a RuntimeContext instance to interact with Php runtime.

Returns:

See Also:

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


68
69
70
# File 'lib/javonet-ruby-sdk/sdk/runtime_factory.rb', line 68

def php
  RuntimeContext.get_instance(RuntimeNameJavonet::PHP, @connection_type, @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(RuntimeNameJavonet::PYTHON, @connection_type, @connection_data)
end

#python27RuntimeContext

Creates a RuntimeContext instance to interact with Python2.7 runtime.

Returns:

  • (RuntimeContext)

    a RuntimeContext instance for the Python2.7 runtime

See Also:

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


75
76
77
# File 'lib/javonet-ruby-sdk/sdk/runtime_factory.rb', line 75

def python27
  RuntimeContext.get_instance(RuntimeNameJavonet::PYTHON27, @connection_type, @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(RuntimeNameJavonet::RUBY, @connection_type, @connection_data)
end