Class: Javonet

Inherits:
Object
  • Object
show all
Defined in:
lib/javonet-ruby-sdk.rb

Overview

The Javonet class is a singleton class that serves as the entry point for interacting with Javonet. It provides methods to activate and initialize the Javonet SDK. It supports both in-memory and TCP connections.

See Also:

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

Class Method Summary collapse

Class Method Details

.activate(licence_key, proxy_host = "", proxy_user_name = "", proxy_password = "") ⇒ Integer

Activates Javonet with the provided license key and optionally with proxy data.

Parameters:

  • licence_key (String) —

    The license key to activate Javonet.

  • proxy_host (String) (defaults to: "") —

    The host for the proxy server (optional).

  • proxy_user_name (String) (defaults to: "") —

    The username for the proxy server (optional).

  • proxy_user_password (String) —

    The password for the proxy server (optional).

Returns:

  • (Integer) —

    The activation status code.

See Also:



38
39
40
# File 'lib/javonet-ruby-sdk.rb', line 38

def self.activate(licence_key, proxy_host="", proxy_user_name="", proxy_password="")
  return Transmitter.activate_with_credentials_and_proxy(licence_key, proxy_host, proxy_user_name, proxy_password)
end

.in_memory ⇒ RuntimeFactory

Initializes Javonet using an in-memory channel on the same machine.

Returns:

  • (RuntimeFactory) —

    A RuntimeFactory instance configured for an in-memory connection.

See Also:

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


16
17
18
19
# File 'lib/javonet-ruby-sdk.rb', line 16

def self.in_memory
  connection_type = ConnectionType::IN_MEMORY
  return RuntimeFactory.new(connection_type)
end

.tcp(address) ⇒ RuntimeFactory

Initializes Javonet with a TCP connection to a remote machine.

Parameters:

  • address (TcpConnectionData) —

    The address of the remote machine.

Returns:

  • (RuntimeFactory) —

    A RuntimeFactory instance configured for a TCP connection.

See Also:

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


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

def self.tcp(address)
  connection_type = ConnectionType::TCP
  return RuntimeFactory.new(connection_type, address)
end