Method: OpenC3::JsonApiObject#initialize

Defined in:
lib/openc3/io/json_api_object.rb

#initialize(url: ENV['OPENC3_API_URL'], timeout: 1.0, authentication: nil) ⇒ JsonApiObject

Returns a new instance of JsonApiObject.

Parameters:

  • url (String) (defaults to: ENV['OPENC3_API_URL'])

    The url of openc3-cosmos-cmd-tlm-api openc3-cosmos-cmd-tlm-api:2901

  • timeout (Float) (defaults to: 1.0)

    The time to wait before disconnecting 1.0

  • authentication (OpenC3Authentication) (defaults to: nil)

    The authentication object if nill initialize will generate



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/openc3/io/json_api_object.rb', line 60

def initialize(url: ENV['OPENC3_API_URL'], timeout: 1.0, authentication: nil)
  @http = nil
  @mutex = Mutex.new
  @request_data = ""
  @response_data = ""
  @url = url
  @log = [nil, nil, nil]
  @authentication = authentication.nil? ? generate_auth() : authentication
  @timeout = timeout
  @shutdown = false
  # JsonDRb.debug = true # Enable for debugging
end