Class: Cosmos::ToolConfigModel
- Defined in:
- lib/cosmos/models/tool_config_model.rb
Class Method Summary collapse
- .delete_config(tool, name, scope: $cosmos_scope) ⇒ Object
- .list_configs(tool, scope: $cosmos_scope) ⇒ Object
- .load_config(tool, name, scope: $cosmos_scope) ⇒ Object
- .save_config(tool, name, data, scope: $cosmos_scope) ⇒ Object
Class Method Details
.delete_config(tool, name, scope: $cosmos_scope) ⇒ Object
34 35 36 |
# File 'lib/cosmos/models/tool_config_model.rb', line 34 def self.delete_config(tool, name, scope: $cosmos_scope) Store.hdel("#{scope}__config__#{tool}", name) end |
.list_configs(tool, scope: $cosmos_scope) ⇒ Object
22 23 24 |
# File 'lib/cosmos/models/tool_config_model.rb', line 22 def self.list_configs(tool, scope: $cosmos_scope) Store.hkeys("#{scope}__config__#{tool}") end |
.load_config(tool, name, scope: $cosmos_scope) ⇒ Object
26 27 28 |
# File 'lib/cosmos/models/tool_config_model.rb', line 26 def self.load_config(tool, name, scope: $cosmos_scope) Store.hget("#{scope}__config__#{tool}", name) end |
.save_config(tool, name, data, scope: $cosmos_scope) ⇒ Object
30 31 32 |
# File 'lib/cosmos/models/tool_config_model.rb', line 30 def self.save_config(tool, name, data, scope: $cosmos_scope) Store.hset("#{scope}__config__#{tool}", name, data) end |