Method: OpenC3::InterfaceModel.handle_config

Defined in:
lib/openc3/models/interface_model.rb

.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: “INTERFACE” Interface/Router specific keywords are handled by the instance method “handle_config” NOTE: See RouterModel for the router method implementation



67
68
69
70
71
72
73
74
75
# File 'lib/openc3/models/interface_model.rb', line 67

def self.handle_config(parser, keyword, parameters, plugin: nil, needs_dependencies: false, scope:)
  case keyword
  when 'INTERFACE'
    parser.verify_num_parameters(2, nil, "INTERFACE <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 Interface: #{keyword} #{parameters.join(" ")}")
  end
end