Class: OpenC3::PythonProxy

Inherits:
Object show all
Defined in:
lib/openc3/utilities/python_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, class_name, *params) ⇒ PythonProxy

Returns a new instance of PythonProxy.



27
28
29
30
31
32
33
# File 'lib/openc3/utilities/python_proxy.rb', line 27

def initialize(type, class_name, *params)
  @type = type
  @class_name = class_name
  @params = params
  @args = params
  @name = nil
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



25
26
27
# File 'lib/openc3/utilities/python_proxy.rb', line 25

def args
  @args
end

#nameObject

Returns the value of attribute name.



24
25
26
# File 'lib/openc3/utilities/python_proxy.rb', line 24

def name
  @name
end

Instance Method Details

#as_json(*args, **kw_args) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/openc3/utilities/python_proxy.rb', line 39

def as_json(*args, **kw_args)
  case @type
  when "Processor"
    return { 'name' => @name, 'class' => @class_name, 'params' => @params }
  when "Conversion"
    return { 'class' => @class_name, 'params' => @params }
  when "LimitsResponse"
    return { "class" => @class_name, 'params' => @params }
  else
    raise "Unknown PythonProxy type: #{@type}"
  end
end

#classObject



35
36
37
# File 'lib/openc3/utilities/python_proxy.rb', line 35

def class
  return @class_name
end