Class: Cloudscale::Constants::Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudscale/monitor/model/constants/agent_store.rb

Constant Summary collapse

@@AGENT_STORE =
"#{File.dirname(__FILE__)}/../../../store/agent/agent.store"

Class Method Summary collapse

Class Method Details

.loadObject



14
15
16
17
18
19
20
# File 'lib/cloudscale/monitor/model/constants/agent_store.rb', line 14

def self.load
  begin
    YAML.load_file(@@AGENT_STORE)
  rescue
    return nil
  end
end

.save(config) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/cloudscale/monitor/model/constants/agent_store.rb', line 22

def self.save(config)
  begin
    File.open(@@AGENT_STORE, 'w') do | h |
      h.write config.to_yaml
    end
  rescue Exception
    return nil
  end        
end