Class: OpenC3::RouterModel

Inherits:
InterfaceModel show all
Defined in:
lib/openc3/models/router_model.rb

Constant Summary

Constants inherited from InterfaceModel

InterfaceModel::INTERFACES_PRIMARY_KEY, InterfaceModel::ROUTERS_PRIMARY_KEY

Instance Attribute Summary

Attributes inherited from InterfaceModel

#auto_reconnect, #cmd, #cmd_target_names, #config_params, #connect_on_startup, #container, #disable_disconnect, #env, #interfaces, #log_stream, #needs_dependencies, #options, #ports, #prefix, #protocols, #reconnect_delay, #secret_options, #secrets, #target_names, #tlm_target_names, #work_dir

Attributes inherited from Model

#name, #plugin, #scope, #updated_at

Class Method Summary collapse

Methods inherited from InterfaceModel

_get_key, _get_type, all, #as_json, #build, #deploy, #ensure_target_exists, get, #handle_config, #initialize, #map_target, names, #undeploy, #unmap_target

Methods inherited from Model

all, #as_json, #check_disable_erb, #create, #deploy, #destroy, #destroyed?, filter, find_all_by_plugin, from_json, get, get_all_models, get_model, #initialize, names, set, store, #undeploy, #update

Constructor Details

This class inherits a constructor from OpenC3::InterfaceModel

Class Method Details

.handle_config(parser, keyword, parameters, plugin: nil, needs_dependencies: false, scope:) ⇒ Object

Called by the PluginModel to allow this class to validate it’s top-level keyword: “ROUTER”



28
29
30
31
32
33
34
35
36
# File 'lib/openc3/models/router_model.rb', line 28

def self.handle_config(parser, keyword, parameters, plugin: nil, needs_dependencies: false, scope:)
  case keyword
  when 'ROUTER'
    parser.verify_num_parameters(2, nil, "ROUTER <Name> <Filename> <Specific Parameters>")
    return self.new(name: parameters[0].upcase, config_params: parameters[1..-1], plugin: plugin,  needs_dependencies: needs_dependencies, scope: scope)
  else
    raise ConfigParser::Error.new(parser, "Unknown keyword and parameters for Router: #{keyword} #{parameters.join(" ")}")
  end
end