Class: OpenC3::ToolConfigModel

Inherits:
Object
  • Object
show all
Defined in:
lib/openc3/models/tool_config_model.rb

Class Method Summary collapse

Class Method Details

.delete_config(tool, name, scope: $openc3_scope) ⇒ Object



40
41
42
43
# File 'lib/openc3/models/tool_config_model.rb', line 40

def self.delete_config(tool, name, scope: $openc3_scope)
  Store.hdel("#{scope}__config__#{tool}", name)
  LocalMode.delete_tool_config(scope, tool, name)
end

.list_configs(tool, scope: $openc3_scope) ⇒ Object



27
28
29
# File 'lib/openc3/models/tool_config_model.rb', line 27

def self.list_configs(tool, scope: $openc3_scope)
  Store.hkeys("#{scope}__config__#{tool}")
end

.load_config(tool, name, scope: $openc3_scope) ⇒ Object



31
32
33
# File 'lib/openc3/models/tool_config_model.rb', line 31

def self.load_config(tool, name, scope: $openc3_scope)
  Store.hget("#{scope}__config__#{tool}", name)
end

.save_config(tool, name, data, scope: $openc3_scope, local_mode: true) ⇒ Object



35
36
37
38
# File 'lib/openc3/models/tool_config_model.rb', line 35

def self.save_config(tool, name, data, scope: $openc3_scope, local_mode: true)
  Store.hset("#{scope}__config__#{tool}", name, data)
  LocalMode.save_tool_config(scope, tool, name, data) if local_mode
end